是否有允许我查看约束内容的 TSQL 脚本.我发现了一个关于 Oracle 的问题,但我需要一个 TSQL 脚本.
Is there a TSQL script that will allow me to see the contents of a constraint. I found a question regarding Oracle but I need a TSQL script.
如何在 Oracle 上查看 Check Constraint 的内容一个>
我知道 sys.check_constraints,但是,所有对象的定义"返回 null.
I am aware of sys.check_constraints, however, the 'definition' comes back null for all objects.
Select * from sys.check_constraints
另一种方式
用于检查约束
select definition,name
from sys.check_constraints
对于默认约束
select definition,name
from sys.default_constraints
另一种方式
SELECT object_definition(OBJECT_ID(CONSTRAINT_NAME)),*
FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS
where CONSTRAINT_TYPE <> 'PRIMARY KEY'
这篇关于如何查看检查约束的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
Sql server 表使用情况统计Sql server table usage statistics(Sql server 表使用情况统计)
t sql中的相对路径?Relative path in t sql?(t sql中的相对路径?)
在 WHERE 条件下获取 SQL 中的最后一条记录Getting the last record in SQL in WHERE condition(在 WHERE 条件下获取 SQL 中的最后一条记录)
在 SQL Server 中使用 FOR XML PATH 查询以获取分层数据Query to get XML output for hierarchical data using FOR XML PATH in SQL Server(在 SQL Server 中使用 FOR XML PATH 查询以获取分层数据的 XML
嵌入在 sum() 函数中的 T-SQL IF 语句T-SQL IF statement embedded in a sum() function(嵌入在 sum() 函数中的 T-SQL IF 语句)
表与临时表性能Table vs Temp Table Performance(表与临时表性能)