Solved

Query Analyzer Copy File

Posted on 2009-05-11
3
244 Views
Last Modified: 2012-05-06
I have successfully copied 39 of 40 databases to a new Server. The one database that does not copy, has a two word name and I am assuming that is why it will not copy. I am using the Query Analyzer and the code I use is listed below. The database name is Kept Appointments the backup .bak file is Kept Appointments.bak.

The error recieved or actually message in Query Analyzer is: The system cannot find the file specified.

Can anyone explain - Thank You
xp_cmdshell 'copy \\A0116-DBS0252-S\D$\MSSQL8DataSEP3\MSSQL$SEP3\BACKUP\Kept Appointments.bak K:\Backup\Kept Appointments\Kept Appointments.bak'

Open in new window

0
Comment
Question by:SeTech
3 Comments
 
LVL 4

Accepted Solution

by:
jason_woods earned 500 total points
ID: 24358436
Have you tried using quotes around each file's full path?
Try both single and double quotes
0
 
LVL 15

Expert Comment

by:mohan_sekar
ID: 24358442
0
 
LVL 39

Expert Comment

by:BrandonGalderisi
ID: 24358589
No points please, but jason_woods' solution would then be.        

xp_cmdshell 'copy "\\A0116-DBS0252-S\D$\MSSQL8DataSEP3\MSSQL$SEP3\BACKUP\Kept Appointments.bak" "K:\Backup\Kept Appointments\Kept Appointments.bak"'
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SQl server restarts itself 6 32
How to run sql statements from SQLCMD or command line 2 53
SQL Server 2012 express 24 34
Help with simplifying SQL 6 47
If you having speed problem in loading SQL Server Management Studio, try to uncheck these options in your internet browser (IE -> Internet Options / Advanced / Security):    . Check for publisher's certificate revocation    . Check for server ce…
INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

943 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now