Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
arkiboys
Master Smack Fu Yak Hacker
1433 Posts |
Posted - 2012-01-06 : 12:11:44
|
Hi,Running a sql statement under a specific windows account...On one server my sql executes fine but on another it gives the following error:Cannot execute as the server principal because the principal "DomainName\AccountName" does not exist, this type of principal cannot be impersonated, or you do not have permission.The sql query I run is xp_cmdshell @paramThanks |
|
Lamprey
Master Smack Fu Yak Hacker
4614 Posts |
Posted - 2012-01-06 : 12:33:27
|
I don't see a question anywhere. |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-01-06 : 13:30:26
|
quote: Originally posted by arkiboys Hi,Running a sql statement under a specific windows account...On one server my sql executes fine but on another it gives the following error:Cannot execute as the server principal because the principal "DomainName\AccountName" does not exist, this type of principal cannot be impersonated, or you do not have permission.Thanks
Is the server also under same domain?have you added the account as a valid login inside?The error clearly suggests it cant find a login inside db------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
arkiboys
Master Smack Fu Yak Hacker
1433 Posts |
Posted - 2012-01-08 : 10:33:49
|
quote: Originally posted by visakh16
quote: Originally posted by arkiboys Hi,Running a sql statement under a specific windows account...On one server my sql executes fine but on another it gives the following error:Cannot execute as the server principal because the principal "DomainName\AccountName" does not exist, this type of principal cannot be impersonated, or you do not have permission.Thanks
Is the server also under same domain?have you added the account as a valid login inside?The error clearly suggests it cant find a login inside db------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/
YES.The account I am using to login is a windows account and not a sql login account. |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-01-08 : 10:45:00
|
wats the sql statement you're trying to run?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2012-01-09 : 02:35:27
|
Have you sourrounded with it by square braces in your code?[DomainName\AccountName]MadhivananFailing to plan is Planning to fail |
 |
|
arkiboys
Master Smack Fu Yak Hacker
1433 Posts |
Posted - 2012-01-09 : 03:09:32
|
quote: Originally posted by madhivanan Have you sourrounded with it by square braces in your code?[DomainName\AccountName]MadhivananFailing to plan is Planning to fail
Do you mean like:xp_cmdshell @param, [DomainName\AccountName], @pwd |
 |
|
arkiboys
Master Smack Fu Yak Hacker
1433 Posts |
Posted - 2012-01-09 : 03:10:18
|
quote: Originally posted by visakh16 wats the sql statement you're trying to run?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/
It is mentioned in the first post.Thanks |
 |
|
|
|
|
|
|