Geeks With Blogs

News


Rodney Vinyard - .NET & SQL Developer When all is said and done, more will be said than done December 2011 Entries
Display Foreign Key Relationships and Name of the Constraint for Each Table in Database
Generate create script for all Foreign Keys Original article: http://connectsql.blogspot.... SELECT 'ALTER TABLE '+OBJECT_NAME(F.PARENT_OBJE... ' ADD CONSTRAINT' + F.NAME + ' FOREIGN KEY'+'('+COL_NAME(FC.PARENT... ')'+'REFRENCES '+OBJECT_NAME (F.REFERENCED_OBJECT_ID)+'(' +COL_NAME(FC.REFERENCED_OBJ... FROM SYS.FOREIGN_KEYS AS F INNER JOIN SYS.FOREIGN_KEY_COLUMNS AS FC ON F.OBJECT_ID = FC.CONSTRAINT_OBJECT_IDGet ......

Posted On Thursday, December 15, 2011 7:04 AM

Copyright © Rodney Vinyard | Powered by: GeeksWithBlogs.net