sys.sql_modules.definition IS NULL for non encrypted views in some of our databases

  • Hi everyone,

    we are using SQL Server 2012 Enterprise Edition since approx. 2 months.

    We recently noticed that the value of the "definition" column of the sys.sql_modules table is null for all our views (these views are not encrypted) in some of the databases, in some other databases this column is correctly set.

    Anyone having the same problem?

    Best regards.

    Carl

  • Funny. And it only happens to views? What happens if you try to script these views?

    [font="Times New Roman"]Erland Sommarskog, SQL Server MVP, www.sommarskog.se[/font]

  • Hi Erland,

    Stored procedures behaves the same.

    I just noticed that when I look at the proterties of these views (in SSMS) being connected as a sysadmin user, the views appears not to be encrypted (as I wrote earlier). But when I connect in SSMS with a more restrictive user these views appears to be encrypted.

    So when I query the sys.sql_modules.definition column being a sysadmin, I see the content of the definition column but with a more restrictive user I can't.

    It makes sense and it is related to security.

    Case close.

    Best regards.

    Carl

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

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