Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Efficiency question with stored procedure

Author  Topic 

John T.
Posting Yak Master

112 Posts

Posted - 2003-04-21 : 08:17:49
TableA has some selections for my users. I want to enter choices to TableB. For example, one selection may be Baltimore,Maryland as a varchar. I am wondering if it is more efficient to pass the value back to the db with an insert in a sproc or do the following. I know that if a user is selecting option "a", then Baltimore,Maryland is an entry in a particular column. Should I query the db :
If "a" then copy Baltimore,Maryland from TableA to TableB? Probably a dumb question but I will ask.
Thanks.

ValterBorges
Master Smack Fu Yak Hacker

1429 Posts

Posted - 2003-04-22 : 10:06:49
Can you post your ddl?
I think the answer in no you don't want copy data between tables if it already exists it would go against the principles of normalization but you'll have to be more specific and give a better example. Also normally you'll want to minimize the amount of traffic between your client and the database.
In your case if you collect all the select options and their id's then pass it to a stored procedure in csv format you can then create a table from a csv as described in one of the articles on this site and insert into table b only the id's of the item's selected.

If you ever wanted to know what the item selected was you'd join tableB to tableA.





Edited by - ValterBorges on 04/22/2003 10:09:36
Go to Top of Page
   

- Advertisement -