May 13, 2009 at 1:32 pm
I am not able to see all the rows in syscomments table. When I login as sa, I can more rows.
SQL Server 2005 Developer Edition.
TIA
May 13, 2009 at 1:35 pm
Hi
syscomments is only available for backward compatibility. Try sys.sql_modules instead:
SELECT
OBJECT_NAME(object_id),
*
FROM sys.sql_modules
Greets
Flo
May 13, 2009 at 1:43 pm
Thanks,
I know I can use sys.sql_modules but still I am Perplexed why sys.syscomments is not showing all rows.
May 13, 2009 at 1:51 pm
I cannot reproduce this effect on my system. Which kind of objects are you missing?
May 13, 2009 at 2:08 pm
Lets say you have 2 logins. One with DBO and another without
DBO can see more rows than other login.
TIA
May 13, 2009 at 2:18 pm
My miss. I didn't read the "sa" part correct...
It's a security feature. Users can only see the object definition with correct permissions. Same depends on sys.sql_modules, OBJECTDEFINITION, INFORMATION_SCHEMA.ROUTINES and some more system views.
Further information:
http://msdn.microsoft.com/en-us/library/ms187113(SQL.90).aspx
Greets
Flo
May 13, 2009 at 3:19 pm
Thanks,
GRANT VIEW ANY DEFINITION TO User1
This will give permission to see all rows to use1 in metadata and catalog view.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply