SQL Server 2005: How to identify all tables referencing a specified table
I have a table which I need to get rid of. But there are several tables in the database re开发者_如何学Pythonferencing this table. Before I remove it, I need to modify the columns in the referencing tables. How can I find out which tables are referencing the table I want to remove?
If they are defined as foreign keys to the database table you can use the command
sp_help TableName
and that will list all of the constraints.
精彩评论