Relationship

  • Thread starter Thread starter shapper
  • Start date Start date
S

shapper

Hello,

I created some SQL 2005 tables using Microsoft SQL Server Management
Studio.
I know wanted to get the script code of those tables.
I was able to do that by right clicking over each table.

But how can I get the code for the relationships between the tables?

Thanks,
Miguel
 
If you choose CREATE to script table to a new window, it should replicate the
T-SQL to create the relationships you have defined.
Peter
 
Hello,

I created some SQL 2005 tables using Microsoft SQL Server Management
Studio.
I know wanted to get the script code of those tables.
I was able to do that by right clicking over each table.

But how can I get the code for the relationships between the tables?

Thanks,
Miguel

In Object Explorer right click on a table, Script Table As... point to
Create

It will generate the DDL script with foreign key relationships
(dependencies to other tables on which the table depends)

To view the dependencies of a table, right-click a table, and then
click View Dependencies...
 
Back
Top