Tuesday, March 27, 2012

copy from C drive of sql server to another sever!

help!
I'm using a SQL server 2000 box and I'm a member of symins on it and I
have a remote drive mounted on the server that I can copy files to with
Explorer and the command line.
I've created a job that has the following line of SQL in it
xpcmdShell 'copy "C:\Program Files\Microsoft SQL
Server\MSSQL\BACKUP\test.txt" "\\madupserver\madeupshare$\testzzzzz.txt"'
and whilst I can make this work in the command line, it tells that my access
is denied...
what can I do to run xpCmdShell with the same priviliges as I have when I'm
running the copy command via the UI of the server
Thanks in advance and regards
CharlesAthis could running as some other user
though i've never encountered this, you could check out who this is
running under using enterprize manager.|||"CharlesA" <CharlesA@.discussions.microsoft.com> wrote in message
news:BCFB6F48-079E-4FFE-A966-22F3B4731A4A@.microsoft.com...
> help!
> I'm using a SQL server 2000 box and I'm a member of symins on it and I
> have a remote drive mounted on the server that I can copy files to with
> Explorer and the command line.
> I've created a job that has the following line of SQL in it
> xpcmdShell 'copy "C:\Program Files\Microsoft SQL
> Server\MSSQL\BACKUP\test.txt" "\\madupserver\madeupshare$\testzzzzz.txt"'
> and whilst I can make this work in the command line, it tells that my
> access
> is denied...
> what can I do to run xpCmdShell with the same priviliges as I have when
> I'm
> running the copy command via the UI of the server
> Thanks in advance and regards
> CharlesA
>
If the SQL Server login running the account is a member of the symins
group, then xp_cmdshell will use the Windows Security account associated
with the MSSQLServer service. If the SQL Server login is not a member of
symins, then xp_cmdshell will run in the context of the SQL Server Agent
Proxy account.
Given your scenario, you need to ensure that the Windows account has the
appropriate privileges on the share.
Rick Sawtell
MCT, MCSD, MCDBA|||Hi Rick,
I'm pretty sure we've had an email dialog before because I remember using
your magnificent book 'TY SQL server 2000 in 21 days' (From SAMS) which got
me into the right thinking mode about SQL server (after years of Access dev
work) I can heartily recommend this work to anyone wishing to understand how
to be a first-time DBA
I hope you're updating it for 2005!
Thanks for you helpful post,
Regards
CharlesAsqlsql

No comments:

Post a Comment