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';
精彩评论