July 14, 2009 at 1:08 am
how can i execute below quesry
actually i need to move bak up files from local drive to shared drive
and all wil be done through mgmt studio ( job will be run)
master.dbo.xp_cmdshell move 'D:\DEV\MSSQL.1\MSSQL\Backup' '\\infs01\Backup\INDBA01$DEV'
thanks
bhuvnesh
-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done;-)
July 14, 2009 at 6:02 am
If you are doing it from a job, then you don’t need to use xp_cmdshell. When you create the job’s step you can select the step’s type. If you select the type Operating System (cmdExec), you can write the move command just like you would write it when you work directly with the operation system. You have to make sure that the login that is used in order to run the agent’s service has permission on both directories source and destination. You also have to make sure that the login knows the UNC path that you are using.
Adi
--------------------------------------------------------------
To know how to ask questions and increase the chances of getting asnwers:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
July 14, 2009 at 6:10 am
can u please tell me script to move it.
give me syntax
-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done;-)
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply