|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Yesterday @ 4:40 AM
Points: 39,
Visits: 47
|
|
i run a Tsql query that move's a file from one computer to another set @sql='move '+@file1+' '+@file2 EXEC master..xp_cmdshell @sql , NO_OUTPUT
now, i want the query to wait until the file arrive's to its destination and only if FileExists to continue the next action
is there something like shellwait until the xp_cmdshell finish is job?
thanks sam
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 8:26 AM
Points: 6,737,
Visits: 11,791
|
|
sam-433147 (2/20/2013) i run a Tsql query that move's a file from one computer to another set @sql='move '+@file1+' '+@file2 EXEC master..xp_cmdshell @sql , NO_OUTPUT
now, i want the query to wait until the file arrive's to its destination and only if FileExists to continue the next action
is there something like shellwait until the xp_cmdshell finish is job?
thanks sam It might be possible, but a feat like this is far easier to achieve in PowerShell, SSIS, .NET...pretty much any other programming or scripting language besides CmdShell. This is not to mention that accessing the file system from T-SQL brings with it a ton of baggage when it comes to security and auditing. Is moving this process out of T-SQL an option for you? If so, I would strongly recommend changing the approach and disabling xp_cmdshell on the Instance if at all possible. If you want help implementing this task in any of the technologies I mentioned I'd be happy to assist.
__________________________________________________________________________________________________ There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Believe you can and you're halfway there. --Theodore Roosevelt
Everything Should Be Made as Simple as Possible, But Not Simpler --Albert Einstein
The significant problems we face cannot be solved at the same level of thinking we were at when we created them. --Albert Einstein
1 apple is not exactly 1/8 of 8 apples. Because there are no absolutely identical apples. --Giordy
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Yesterday @ 4:40 AM
Points: 39,
Visits: 47
|
|
thanks for the reply and the willingness to help I'm not familiar with PowerShell or other scripting language besides sql
any assistance will be wonderful
sam
|
|
|
|