Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


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


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

Author
Message
Carl B.
Carl B.
Mr or Mrs. 500
Mr or Mrs. 500 (537 reputation)Mr or Mrs. 500 (537 reputation)Mr or Mrs. 500 (537 reputation)Mr or Mrs. 500 (537 reputation)Mr or Mrs. 500 (537 reputation)Mr or Mrs. 500 (537 reputation)Mr or Mrs. 500 (537 reputation)Mr or Mrs. 500 (537 reputation)

Group: General Forum Members
Points: 537 Visits: 371
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



Erland Sommarskog
Erland Sommarskog
SSC Eights!
SSC Eights! (931 reputation)SSC Eights! (931 reputation)SSC Eights! (931 reputation)SSC Eights! (931 reputation)SSC Eights! (931 reputation)SSC Eights! (931 reputation)SSC Eights! (931 reputation)SSC Eights! (931 reputation)

Group: General Forum Members
Points: 931 Visits: 866
Funny. And it only happens to views? What happens if you try to script these views?

Erland Sommarskog, SQL Server MVP, www.sommarskog.se
Carl B.
Carl B.
Mr or Mrs. 500
Mr or Mrs. 500 (537 reputation)Mr or Mrs. 500 (537 reputation)Mr or Mrs. 500 (537 reputation)Mr or Mrs. 500 (537 reputation)Mr or Mrs. 500 (537 reputation)Mr or Mrs. 500 (537 reputation)Mr or Mrs. 500 (537 reputation)Mr or Mrs. 500 (537 reputation)

Group: General Forum Members
Points: 537 Visits: 371
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



Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search