Drop Table
Support Forum for database administrators and web based access to important newsgroups related to databasesI 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,
Post Follow-up to this messagePerhaps 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,
Post Follow-up to this messageIf 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,
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread