Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

How to script object level permission in SQL 2005? Expand / Collapse
Author
Message
Posted Tuesday, September 28, 2010 12:05 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, September 19, 2014 1:25 PM
Points: 123, Visits: 313
I tried using Greg's script and it works perfectly for my needs on my production server, but when I attempt to run it on my test server, I'm getting a strange error. Both servers are running SQL Server 2005 sp2

Does anyone have any idea what might be causing this?

An error occurred while executing batch. Error message is: The directory name is invalid.
Post #994698
Posted Tuesday, September 28, 2010 12:15 PM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Today @ 3:00 AM
Points: 882, Visits: 2,481
Can you provide the script or link to it that you are using?

Are all the directories you have referenced in the script valid?


Shawn Melton
PS C:\>(Find-Me).TwitterURL
@wsmelton
PS C:\>(Find-Me).BlogURL
meltondba.wordpress.com
Post #994705
Posted Tuesday, September 28, 2010 12:20 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, September 19, 2014 1:25 PM
Points: 123, Visits: 313
This is the script. The username exists and has permissions. I can run this script on my local install of SSMS remotely connected to the test server. I can run the script on my production server. I just can't run it in SSMS on the test server itself. I'm not really referencing any directories. That's why this error message is so confusing.

declare @username as varchar(50)
set @username = 'cashnet'

select O.name, permission_name from sys.database_permissions
join sys.sysusers U on grantee_principal_id = uid
join sys.sysobjects O on major_id = id
where U.name = @username
order by O.name
Post #994713
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse