September 23, 2005 at 12:54 pm
hi all,
trying to copy data file from one server to another, but I get a syntax error.
this is the code that I'm using:
exec master..xp_cmdshell 'copy H:\Data\MSSQL\Data\Lennar_CFT.mdf \\ldc-dba-sql-ga\c$\Program Files\Microsoft SQL Server\MSSQL\Data'
this is the error:
The syntax of the command is incorrect.
can someone look at this and tell me what I'm doing wrong?
thanks in advance
September 23, 2005 at 12:56 pm
Due to the space in the file name, you need to put it in double quotes:
exec master..xp_cmdshell 'copy H:\Data\MSSQL\Data\Lennar_CFT.mdf "\\ldc-dba-sql-ga\c$\Program Files\Microsoft SQL Server\MSSQL\Data"'
like that.
Lynn
September 23, 2005 at 1:01 pm
thank you Lynn
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply