How can I find out what FOREIGN KEY constraint references a table in SQL Server?

前端 未结 15 835
再見小時候
再見小時候 2020-12-04 05:12

I am trying to drop a table but getting the following message:

Msg 3726, Level 16, State 1, Line 3
Could not drop object \'dbo.UserProfile\' bec

15条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-04 06:02

    In SQL Server Management Studio you can just right click the table in the object explorer and select "View Dependencies". This would give a you a good starting point. It shows tables, views, and procedures that reference the table.

提交回复
热议问题