Friday, March 30, 2012

How to view constraints...?

Hi all. I have a SQL Server DB that i need to port out of SQL Server. I do not have a diagram illustrating the constraints in the construct of the tables. What is the best way to for me learn the relationships of the tables in sql server?
thanks for your helpI'd recommend using a tool like ErWin or Visio to construct a diagram.

If that isn't acceptable, I'd script the entire database using SQL Enterprise Mangler and look for the primary key and foreign key definitions. This is free, but it can take a lot of work.

If that doesn't work for you, then I'd need to understand why it wasn't acceptable before I could even venture a guess as to what you might want to try next.

-PatP|||You can also use sp_helpconstraint 'tablename' to find not only the freign keys on 'tablename', but also the foreign keys that reference 'tablename'.|||Where are you porting your db to? Are you sure that's what you want to do?

No comments:

Post a Comment