Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Default value for default constraints 1

Status
Not open for further replies.

mreigler

Programmer
Dec 12, 2002
33
US
I'm trying to programmatically script out the default constraints from tables in one database to update copies of those tables in another database. I have the table name, column name, and constraint name from syscolumns and sysconstraints, but I haven't been able to find where the default value is stored.


Mike Reigler
Melange Computer Services, Inc
 
Table syscomments - [text] holds default's code, id/colid are keys to join.

------
[small]select stuff(stuff(replicate('<P> <B> ', 14), 109, 0, '<.'), 112, 0, '/')[/small]
[banghead]
 
I have found the following help file to be helpful when trying to extract information from the server configuration tables.


It also comes on the CD with the SQL Server 2000 Resource Kit.

I haven't located a similar resource in SQL Server 2005 yet. Perhaps someone here can elaborate on whether something like that exists for SQL2005 or how much difference there would be between these structures in 2K and 2005 versions.
 
Thanks vongrunt, that did it.

Mike Reigler
Melange Computer Services, Inc
 
System tables in SQL2005 are radically changed, information_schema views are still there.

------
[small]select stuff(stuff(replicate('<P> <B> ', 14), 109, 0, '<.'), 112, 0, '/')[/small]
[banghead]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top