Ok thanks all,
Yes it is a one time execution, ok maybe a sql query would be the best
thing from what I have read so far. I was just curious on my optiond,
because I have about 20 fields in one table that instead of being index
to another table holds the same data over and over again, which I
consider a waste of space.
So there is a bit of processing of data that needs to be done after the
read but before the write.
Well I was also thinking of taking the DB off line, when the site is not
at its busiest and run this query and have it done as quickly as
possible. If a view would be better, I am open to suggestions on what
would be best.
Regards,
Andrew Scott
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Saturday, 1 September 2001 4:49 AM
To: SQL
Subject: RE: Point me in the Right Direction
My assumption was that you're looking to "migrate in place" - that is,
design the database the way it should have been and then implement it
into
the same db name on the same database server. That way, the
applications
keep running and you flash cut over a weekend to the new structures. In
a
situation like that, you wouldn't have duplicate table names, because
you
would replace the tables with the views.
If you're not looking to do that, then the suggestion of a one-time
SELECT
INTO or equivalent would be better.
Remember - as soon as you say "loop through a table", you're talking
about
using a cursor. SQL works with *sets* of data, and the only way to do a
loop over a set of data is with a cursor. Unless you're taking a
different
action based on the value of the data, there's probably a better way to
do
it that doesn't use a cursor.
As for resources, there are plenty that come up if you search on +sql
+"stored procedure" from Yahoo! Swynk.com has a SQL script library
that
you might want to check out.
|----------------+------------------------------------------------------
--|
|Eric A. Laney |"What counts is not necessarily the size of the dog in
|
|Systems Engineer|the fight; it's the size of the fight in the dog."
|
|LAN Optimization|
|
|Team |
|
|Verizon Data | Dwight D.
Eisenhower|
|Services |
|
|Voice: |
|
|813.978.4404 |
|
|Pager: |
|
|888.985.8519 |
|
|----------------+------------------------------------------------------
--|
"Andrew
Scott" To: SQL
<[EMAIL PROTECTED]>
<andrewcs@tig cc:
.com.au> Subject: RE: Point me in
the Right Direction
08/31/2001
01:05 PM
Please
respond to
sql
Thanks,
Sorry I sort of understood you on this, views wouldn't work (well
technically it would) but it means I would have 2 instances of tables.
If I understood you right.
Do you have any examples of a SP that could do what I am looking for,
that would loop through a table and then take the data and write this to
a new field. Yes I am sort of new to SP, or if you can recommend a good
book or site to look at.
Regards,
Andrew Scott
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Saturday, 1 September 2001 2:27 AM
To: SQL
Subject: Re: Point me in the Right Direction
Stored procedures sound like the best way to go. They'll be the
fastest,
too. The only thing that may change that is if you have lots of
conditional processing. Conditional processing in SQL requires the use
of
a cursor, which will be a lot slower and more resource intensive on your
db
server.
Keep in mind that depending on your DBMS and whether your web
applications
are primarily reading or writing, you may be able to define a view that
is
laid out the same as the old database so you don't have to rewrite the
web
applications when the database changes. Some DBMSs even allow you to
update and insert on a view. YMMV.
|-------------------------+---------------------------------------------
--|
|Eric A. Laney |Of all the animals, the boy is the most
|
|Systems Engineer |unmanageable.
|
|LAN Optimization Team |
|
|Verizon Data Services |
|
|Voice: 813.978.4404 |
|
|Pager: 888.985.8519 |
|
|-------------------------+---------------------------------------------
--|
"Andrew
Scott" To: SQL
<[EMAIL PROTECTED]>
<andrewcs@tig cc:
.com.au> Subject: Point me in the
Right Direction
08/31/2001
12:13 PM
Please
respond to
sql
I have taken over from a project where the DB is a mess, now the site is
live and I am redeveloping this and redesigning the DB to be more
compact than it is now.
Here is my question. I am not too up on StoredProcs. Or other methods,
so forgive me if I don't explain this well. But I am looking for a
method, that would be able to take a row from a current table and split
the data into multiple tables. I am assuming that this would be better
done in a SP, or would there be a better method?
Any help, advice or pointers would be grateful.
Regards,
Andrew Scott
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists