views:

138

answers:

1

I am using sqlcmd in a T-SQl script to write a text file to a network location. However SQLCMD is failing to write to that location due to access permission to the network folder. SP is being run under my user account which has access to the network folder.

Could you please help me under which account sqlcmd will run if I do not specify -U and -P option in TSQL Script?

+2  A: 

If you don't provide credentials with -u/-p it will try to use windows authentication; i.e the windows account of whomever is running it.

I often just use Process Monitor to look at what account is being used and what the permission error is.

Alex K.
You have troubles finding column `User Name` in Task Manager?
wqw
If you open up the command prompt and type SET you will see the logged on user it is trying to use from your session.
Ioxp