December 16, 2010 at 8:53 am
We develop an app that connects to a SQL back end. Users log into the app using various usernames and passwords. But the app always logs into SQL Server as a sysadmin account called "ConEst". The standard user doesn't need to know this password in normal usage.
I'm working on an SP that will use xp_cmdshell to export a bunch of data via bcp. As per what I've described above, this SP is always being executed by the ConEst user. But I need the ConEst user's password for the command string, so I can do this:
exec xp_cmdshell @Query queryout @Filename -n -U ConEst -P @pwd, no_output
So... is there some way for the logged in user to derive his own password?
Thanks!
Ron Moses
ConEst Software Systems
-----
a haiku...
NULL is not zero
NULL is not an empty string
NULL is the unknown
December 16, 2010 at 9:15 am
nope there's no way, AFAIK.
your options are to use a trusted connection with their windows login so you don't need the username and password at all,, or to use EXECUTE AS inside the procedure so it runs as a user that has permissions;
Lowell
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply