November 5, 2004 at 3:43 pm
Comments posted to this topic are about the content posted at http://www.sqlservercentral.com/columnists/
1234
December 15, 2004 at 8:30 am
Very handy script.
Note: I have a few databases with spaces in the name of the database. This frequently trips up scripts but yours is easy to enhance for such a situation. Simply change below line:
, SU.name,SO.name from '+@dbname+'.dbo.sysobjects SO join '+@dbname+'.dbo.sysusers SU
to:
, SU.name,SO.name from ['+@dbname+'].dbo.sysobjects SO join ['+@dbname+'].dbo.sysusers SU
Thanks for sharing your code.
-Mike
Mike
December 15, 2004 at 8:52 am
Definitely a handy script. Although the developers in my company all have dbo privileges to the development database, our Windows Group login is mapped to a user other than dbo. We are forever creating procedures without specifying the [dbo]. in [dbo].[<procedurename>] and ending up owning the procedure instead of dbo.
I would make one enhancement to the script. Right after the SET NOCOUNT ON line, I would add this line:
DELETE FROM [ObjList]
to prevent duplicates from a previous execution from appearing in the table
December 16, 2004 at 4:56 am
Mike,
Thanks for the suggestion.
Santveer
1234
December 16, 2004 at 5:03 am
I didn't include DELETE FROM [ObjList] becuase I want to maintain the history also. If some one don't want to maintain the history, he/she may include the DELETE statement. This is just a concept and we can use it in different ways.
Thanks a lot for your time.
1234
December 15, 2005 at 7:08 am
It is a usefull Script; however, I will avoid the cursor.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply