Does anyone know how to get an equivalent of the SQL Server 2000 sysobjects uid column from the 2005+ sys.objects (or another) view?
I am trying to convert this code, as we are getting rid of all sysobjects references.
DECLARE GETOBJECTS CURSOR FOR
SELECT NAME, UID FROM SYSOBJECTS
WHERE TYPE IN ('U','P')
AND UID <> 1
AND LOWER(RTRIM(NAME)) NOT LIKE 'PB%'
Thanks in advance,
Kevin
UID refers to the User ID of the owner of the object…
In SQL 2005 and SQl 2008, you can find it in
field name UID
Sys.sysobjects
UID =1 is the dbo user.
So to use the routines and tables views and filter out dbo, try the following code