How to get the script to create foreign keys for the whole database? SQL Server 2008

2

I would like to know if there is any command that returns me the script of creating the foreign keys in SQL server, as well as the command sp_helptext I return the creation script of views and stored procedures for example.

Thanks

    
asked by anonymous 06.11.2014 / 14:15

1 answer

1
exec sp_helpconstraint <tabela>

will return all dependencies that exist with this table and from that table.

    
06.11.2014 / 15:37