How do you find a RULE associated with a column?

I have a SQL database in which there is a table, and there is a column in this table.

I use NHibernate to update to a record when I get this exception, stating that I am breaking some rule in a column.

I am doing some research to find out that the database has a rule associated with this column, but I have no idea how to find this rule, see what it does, etc.

Does anyone know how to show rules for a column? Or just all the rules in the database, everything to make me move in the right direction.

** EDIT **

The exact error message is:

Insert a column or update with the rule set by the previous CREATE RULE expression. The application has been discontinued. The conflict occurred in the database '[MYDB]', table '[MYTABLE]', column '[MYCOLUMN]'.

+4
source share
2 answers

Make sp_help TableName . It will return several sets of results, one of which (7th) shows contraindications in the table.

You can also check other results for nullable columns, identifier columns, etc.

+5
source

Take a look at SQL Server Management Studio.

Connect to SQL Server, navigate to the database, then open the programming section.
Go to the rules folder and list all the rules in the database.

+4
source

Source: https://habr.com/ru/post/1342165/


All Articles