March 14, 2011 at 9:42 am
Hello,
I'm trying to read a folder located on another server.
1. I have created a credential (Identity is <domainname>\<username>
2. I have created a proxy (Operating System cmdExec) associated with the credential.
I'm using the following command
GRANT exec ON xp_cmdshell TO <credential>
set @strcmd = 'dir '+@strFolder + '*.*'
exec @result = xp_cmdshell @strcmd
and I get this :
Msg 4629, Level 16, State 10, Procedure ImportAvailabilities, Line 33
Permissions on server scoped catalog views or system stored procedures or extended stored procedures can be granted only when the current database is master.
Why ???
Tks for your help !
March 14, 2011 at 9:51 am
DZN (3/14/2011)
Hello,I'm trying to read a folder located on another server.
1. I have created a credential (Identity is <domainname>\<username>
2. I have created a proxy (Operating System cmdExec) associated with the credential.
I'm using the following command
GRANT exec ON xp_cmdshell TO <credential>
set @strcmd = 'dir '+@strFolder + '*.*'
exec @result = xp_cmdshell @strcmd
and I get this :
Msg 4629, Level 16, State 10, Procedure ImportAvailabilities, Line 33
Permissions on server scoped catalog views or system stored procedures or extended stored procedures can be granted only when the current database is master.
Why ???
This is by design, check here... http://msdn.microsoft.com/en-us/library/ms186717.aspx
_____________________________________
Pablo (Paul) Berzukov
Author of Understanding Database Administration available at Amazon and other bookstores.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.March 14, 2011 at 9:53 am
so how to implement ? What's the solution ?
March 14, 2011 at 2:20 pm
DZN (3/14/2011)
so how to implement ? What's the solution ?
Make master your current database.
_____________________________________
Pablo (Paul) Berzukov
Author of Understanding Database Administration available at Amazon and other bookstores.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.March 15, 2011 at 2:00 am
Tks will do this.
Now from a general perspective, could I do this temporarely ? What happens is another SP would do the same at the same time for another db?
March 16, 2011 at 4:27 am
Can you not put at the top of the script
Use [Master]
go
Would be a lot simpler
March 16, 2011 at 10:11 am
OK. Good idea
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply