How can I find the name of a named not-null constraint in SQL Server? I can find check constraints, default constraints, FK constraints, PK constraints and unique constraints, but the NN constraint has eluded me.
相关问题
- sql execution latency when assign to a variable
- What means in Dart static type and why it differs
- What is the best way to cache a table from a (SQL)
- php PDO::FETCH_ASSOC doesnt detect select after ba
- Bulk update SQL Server C#
相关文章
- Entity Framework 4.3.1 failing to create (/open) a
- Code for inserting data into SQL Server database u
- Notice: Undefined property - how do I avoid that m
- SQL Server 2008 Change Data Capture, who made the
- Delete Every Alternate Row in SQL
- Linux based PHP install connecting to MsSQL Server
- SQL Azure Reset autoincrement
- How do we alias a Sql Server instance name used in
You can't.
Whilst the syntax does accept a name...
... and it is parsed and validated as a name ...
... this is then ignored and isn't actually stored anywhere.
No row is added to
sys.objects
for these unlike other constraints. It is just stored as a bit property of the associated column rather than a constraint object.Notes
Replace Your table name here on line 1 at the top of the query, with the name of the table you need a list for.
If you also need to know the data type of each column, uncomment line 4 by deleting the two dashes at the start of the line.
You are able to query from the information _schema all columns that are nullable. Does that get you what you want?