Drop Table

Support Forum for database administrators and web based access to important newsgroups related to databases
Register on Database Support Forum Edit your profileCalendarFind other Database Support forum membersFrequently Asked QuestionsSearch this forum -> 
For Database admins: Free Database-related Magazines Now Free shipping to Texas


Post New Thread










Thread
Author

xp_cmdshell ACCESS IS DENIED
I am trying to use xp_cmdshell to daily copy a SQL Server database backup
file from server A to B.

USE Master
GO
EXEC 'xp_cmdshell D:\NMEX_db_12122006.BAK \\b\K$'

Output Results: Access is denied

When I map a drive to Server b and drive K, I am able to copy the
D:\NMEX_db_12122006.BAK file to the K drive using Windows Explorer.

Please help me determine why I receive "Access is denied" error from
xp_cmdshell within SQL Query Analyzer. But I am able to complete this task
with windows explorer by mapping the server and drive and copying the file
with windows explorer.

Thanks,

Report this thread to moderator Post Follow-up to this message
Old Post
Joe K.
12-13-06 05:13 AM


Re: xp_cmdshell ACCESS IS DENIED
Perhaps the Proxy account does not have permission to write to \\b\K$...

Or you are not a admin on the SQL Server and don't have permissions to use
xp_cmdshell...

--
Arnie Rowland, Ph.D.
Westwood Consulting, Inc

Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous

You can't help someone get up a hill without getting a little closer to the
top yourself.
- H. Norman Schwarzkopf


"Joe K." <JoeK@discussions.microsoft.com> wrote in message
news:F1E6ABFA-C00A-42EA-A49E- 22B699E8D34F@microso
ft.com...
>
> I am trying to use xp_cmdshell to daily copy a SQL Server database backup
> file from server A to B.
>
> USE Master
> GO
> EXEC 'xp_cmdshell D:\NMEX_db_12122006.BAK \\b\K$'
>
> Output Results: Access is denied
>
> When I map a drive to Server b and drive K, I am able to copy the
> D:\NMEX_db_12122006.BAK file to the K drive using Windows Explorer.
>
> Please help me determine why I receive "Access is denied" error from
> xp_cmdshell within SQL Query Analyzer. But I am able to complete this task
> with windows explorer by mapping the server and drive and copying the file
> with windows explorer.
>
> Thanks,



Report this thread to moderator Post Follow-up to this message
Old Post
Arnie Rowland
12-13-06 05:13 AM


Re: xp_cmdshell ACCESS IS DENIED
If you are trying to backup across the network you should use UNC names
rather than mapped drives.  Here is a KB article on exactly how.  The focus
is on the maintenance wizard, but the requirements are the same when using a
command-line backup.

HowTo: Backup to UNC name using Database Maintenance Wizard
http://support.microsoft.com/?kbid=555128

--
Geoff N. Hiten
Senior Database Administrator
Microsoft SQL Server MVP


"Joe K." <JoeK@discussions.microsoft.com> wrote in message
news:F1E6ABFA-C00A-42EA-A49E- 22B699E8D34F@microso
ft.com...
>
> I am trying to use xp_cmdshell to daily copy a SQL Server database backup
> file from server A to B.
>
> USE Master
> GO
> EXEC 'xp_cmdshell D:\NMEX_db_12122006.BAK \\b\K$'
>
> Output Results: Access is denied
>
> When I map a drive to Server b and drive K, I am able to copy the
> D:\NMEX_db_12122006.BAK file to the K drive using Windows Explorer.
>
> Please help me determine why I receive "Access is denied" error from
> xp_cmdshell within SQL Query Analyzer. But I am able to complete this task
> with windows explorer by mapping the server and drive and copying the file
> with windows explorer.
>
> Thanks,


Report this thread to moderator Post Follow-up to this message
Old Post
Geoff N. Hiten
12-13-06 05:13 AM


Sponsored Links





Last Thread Next Thread
Post New Thread

MS SQL Server archive

Show a Printable Version Email This Page to Someone! Receive updates to this thread
Microsoft SQL Server
Access database support
PostgreSQL Replication
SQL Server ODBC
FoxPro Support
PostgreSQL pgAdmin
SQL Server Clustering
MySQL ODBC
Web Applications with dBASE
SQL Server CE
MySQL++
Sybase Database Support
MS SQL Full Text Search
PostgreSQL Administration
SQL Anywhere support
DB2 UDB Database
Paradox Database Support
Filemaker Database
Berkley DB
SQL 2000/2000i database
ASE Database
Forum Jump:
All times are GMT. The time now is 08:46 PM.

 
Mobile devices forum | Database support forum archive




Copyrights DropTable.com Database Support Forum 2004 - 2006