|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Friday, January 28, 2011 11:35 AM
Points: 75,
Visits: 2
|
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Thursday, June 30, 2011 9:02 AM
Points: 9,
Visits: 82
|
|
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
Regards,
Mike
|
|
|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Monday, November 20, 2006 10:12 AM
Points: 78,
Visits: 1
|
|
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
|
|
|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Friday, January 28, 2011 11:35 AM
Points: 75,
Visits: 2
|
|
Mike, Thanks for the suggestion. Santveer
1234
|
|
|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Friday, January 28, 2011 11:35 AM
Points: 75,
Visits: 2
|
|
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
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Wednesday, March 06, 2013 12:15 PM
Points: 332,
Visits: 104
|
|
| It is a usefull Script; however, I will avoid the cursor.
|
|
|
|