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 - 2004-12-16 : 06:57:50
|
| Dina writes "Hi,I currently have about 95 tables in my database. Some of the tables contain a primary key that consists of an id and the corresponding version number. Other tables contain a primary key that is an identity. When an update is made on the tables with a version number, the version number is incremented. When an update is made to the identity tables, obviously that identity number is incremented. All of these tables are linked together somehow. What I need help with is getting all the version numbers and identities updated throughout the database. So that when a version number is incremented, that new record will be inserted in to the child table and a new identity will be created. Then from that new identity that has been created, it will update all of it's child tables and so on and so forth. Is there a procedure out there that allows a user to input a table name, the old parameter, the new parameter, checks for any children, possibly loops around or something like that? Any helpful suggestions are greatly appreciated. I'm hoping one procedure to loop around and update will save me from writing 100's of little statements to loop through tables and clean up the data. THANKS!Dina" |
|
|
|
|
|