开发者

SQL command to show if table is set to cascade on delete

I need to delete some SQL Azure database entries, and I'm not sure if the casca开发者_如何转开发de on delete is specified or not. If I by accident delete something important, I'm in a world of hurt. So, is there a command to check for cascade deletion?


Use sp_fkeys to find it. http://msdn.microsoft.com/en-us/library/ms175090.aspx Look at the resultset's "DELETE_RULE" column.

0=CASCADE
1=NO ACTION

An example:

USE MyDB;
GO
EXEC sp_fkeys @pktable_name = N'MyTable',@pktable_owner = N'MyUserName';
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜