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.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2001-07-02 : 08:11:12
|
Matt writes "Hello,
I have three tables all linked sequentially through standrad 1 to many relationships eg;
TABLE1-->TABLE2-->TABLE3
TABLE2 has a foreign key which refers to the PK in TABLE1 and TABLE3 has a FK which refers to TABLE2. Occasionally I need to create a complete duplicate of these records and at the moment I do this via three seperate Spocs referenced from an ASP page which INSERT's the data for TABLE1 and passes back an output parameter for the FK in TABLE2 and the same again for TABLE3.
Is there a way to do this within 1 stored procedure? I wondered if using cursors would be the answer but I havn't used them before and I have heard they are the evil spawn of satan and if I use them I will die and the ice caps will melt etc... Perhaps I am exagerating.
Thanks
Matt Tordoff" |
|
|
|
|
|