Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Permissions issue with sys.default_constraints?

Author  Topic 

Kristen
Test

22859 Posts

Posted - 2010-09-20 : 13:34:28
I'm not seeing values in the [definition] column in sys.default_constraints using data_reader permissions (I think that's the issue, I see them fine using SA)

Any ideas pls?

Sample:

SELECT TOP 100 O.name, C.name, DEF.definition
FROM sys.objects AS O
JOIN sys.columns AS C
ON C.object_ID = O.object_ID
JOIN sys.default_constraints AS DEF
ON DEF.parent_column_ID = C.column_ID
AND DEF.object_id = C.default_object_id
AND DEF.[definition] IS NOT NULL
WHERE O.Type = 'U'

am I possibly joining columns wrongly (i.e. in a way that works for SA but changes for other users?)

slimt_slimt
Aged Yak Warrior

746 Posts

Posted - 2010-09-21 : 02:01:05
check for permissions since these are system views.
joins in query are perfectly fine.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-09-21 : 02:45:03
What permission do I need to grant?

This is just a single column that is missing data. Thus user must have permissions on the appropriate tables (otherwise they would get an error, no?)

Or am I missing something perhaps?
Go to Top of Page
   

- Advertisement -