System table to find out RULE definition

  • Hi,

    if i use SP_HELPTEXT then i can see the definition of the RULE.

    Is there any where to see which System table stores the definition of the RULE.

    reagrds

    sandhya

  • find any column that has been tied to a rule:

    select

    object_name(syscolumns.id) as tablename,

    syscolumns.name as columnname,

    object_name(syscolumns.domain) as RuleName,

    syscomments.TEXT as RuleDefinition

    from syscolumns

    inner join syscomments on syscolumns.domain = syscomments.id

    where syscolumns.domain > 0

    a rule that exists, but may or may not be tied to a column:

    select name as RuleName,

    syscomments.TEXT as RuleDefinition

    from sysobjects

    inner join syscomments on sysobjects.id = syscomments.id

    where sysobjects.xtype='R'

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • sandhya_vemulla (4/22/2009)


    Is there any where to see which System table stores the definition of the RULE.

    You are looking for the system view sys.all_sql_modules. Specifically the definition column.

    Wayne
    Microsoft Certified Master: SQL Server 2008
    Author - SQL Server T-SQL Recipes


    If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
    Links:
    For better assistance in answering your questions
    Performance Problems
    Common date/time routines
    Understanding and Using APPLY Part 1 & Part 2

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply