asked on
ASKER
--Create Table of DB Names / backup files to Restore
DECLARE @XPCMD_MoveOutputTABLE
(
Output sysname null
)
--Declare FileName Handler
DECLARE @filename varchar(255)
--Execute Move, capture output and incert it into the database line by line (The loop is required for this to process properly)
INSERT @XPCMD_MoveOutputexec (' xp_cmdshell ''echo off & for /f "tokens=*" %v in (''''MOVE "C:\Start' + @filename + '" "C:\End\' + @filename + '" '''') do echo %~nv''')
--Check the contents of that Log of all your moves
Select Output from @XPCMD_MoveOutputexec
Microsoft SQL Server 2005 is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning. It includes support for managing XML data and allows a database server to be exposed over web services using Tabular Data Stream (TDS) packets encapsulated within SOAP (protocol) requests.
TRUSTED BY
EXEC xp_cmdshell 'for /f "delims=" %F in ("C:\mypath\myfile.csv") do move "C:\Start%F" "C:\End"'