Monday, March 19, 2012

Help : Rule

Dear All,
I have created a rule and i have bind it to several columns in server
tables.
For documentation purposes, I need to make list of bind columns to that
rule.
How to do that?
Thanks
Robert LieAny reason why you are using rules rather than CHECK constraints? Rules
have been deprecated since version 7.0. CHECK constraints are more
powerful, easier to use and are highly recommended instead of rules.
Also, unlike rules, CHECK constraints can be used by the optimizer to
improve the performance of your queries.
Try this to list all columns with rules:
SELECT
OBJECT_NAME(id) AS table_name,
name AS column_name,
OBJECT_NAME(domain) AS rule_name
FROM syscolumns
WHERE OBJECTPROPERTY(domain,'IsRule')=1
--
David Portas
SQL Server MVP
--

No comments:

Post a Comment