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)
 Fabulous usage of metadata

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-01-04 : 08:27:44
Mace writes "Do you have a script or advice on a really cool function which would allow one to change a column value in every table where this column exists? Additionally... turning constraint checking off beforehand and then on again (as necessary on a table by table basis) as the script runs would be cool.

For example... say I have an account id which apppear in 50 of 100 tables in a system. Many of these table use account id as a primary key but some don't... and many table don't even have the column.

If I need to change the Account ID to a new value everywhere it exists... having a cool function using metadata would be great.

Thanks.
mace"

nathans
Aged Yak Warrior

938 Posts

Posted - 2006-01-04 : 10:56:29
I think you want Cascading Updates, though you will need to have proper RI on the tables you want to update.

[url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/createdb/cm_8_des_04_92ib.asp[/url]

Nathan Skerl
Go to Top of Page
   

- Advertisement -