开发者

How do you find the RULE associated to a column?

I have a SQL Database that has some Table and in that table there's a Column.

I'm using NHibernate to do an update to a record, when I get this exception saying I'm violating some RULE on the column.

I do some research to find out there's a RULE associated with that column in the database, but I have no idea how to find this rule, see what it does, etc.

Does anyone know how to show the rules for a column? Or just all the rules in the database, anything to get me heading in the right direction.

** EDIT **

The 开发者_如何学Cexact error message is:

A column insert or update conflicts with a rule imposed by a previous CREATE RULE statement. The statement was terminated. The conflict occurred in database '[MYDB]', table '[MYTABLE]', column '[MYCOLUMN]'.


Do sp_help TableName. It will return a number of resultsets, one of which (the 7th one) shows the contraints on the table.

You can also inspect the other resultsets for not nullable columns, identity columns, etc.


Look in SQL Server Management Studio.

Connect to the SQL Server, browse to the database, then open the programmability section.
Go to the rules folder, and that will list all the rules in the database.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜