Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
assh11
Starting Member
7 Posts |
Posted - 2010-04-25 : 19:14:24
|
Hi All,In the query analyzer I am giving the following command.exec master.dbo.xp_cmdshell 'copy d:\Program Files\Microsoft SQL Server\MSSQL\Data\MyDatabase_Data.MDF c:'I am getting the following error:1. The system can not find the path specified2. NULLWhat is the problem with the command? If anyone knows please let me know. Your help is greatly appreciated.Thank you,Assh |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
assh11
Starting Member
7 Posts |
Posted - 2010-04-25 : 19:55:16
|
Hi,It is working now. The problem is with the source file path because it has many spaces in it. The correct command is exec master.dbo.xp_cmdshell 'copy d:\Program" "Files\Microsoft" "SQL" "Server\MSSQL\Data\MyDatabase_Data.MDF c:\MyDatabase_Data.MDF'we need to add double quotes in place of spaces.Thank you,Assh |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|