Home Forums Article Discussions Article Discussions by Author Discuss Content Posted by Brandie Tarvin SQL 2005 Get Roles, Schemas & Object Permissions RE: SQL 2005 Get Roles, Schemas & Object Permissions
Jerry Hung
SSChampion
Points: 12968
More actions
November 28, 2008 at 8:15 am
#904818
Thanks for the code
I think you missed the @DBName declaration at the top
Declare @sqlstmt varchar(5000);
declare @DBName sysname;
set @DBName = DB_NAME()
set @sqlstmt = 'use ['+@DBName+']' + char(10)