﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2005 / SQL Server Newbies  / shellwait / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Mon, 20 May 2013 08:33:57 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: shellwait</title><link>http://www.sqlservercentral.com/Forums/Topic1422251-1291-1.aspx</link><description>thanks for the reply and the willingness to helpI'm not familiar with PowerShell or other scripting language besides sqlany assistance will be wonderfulsam</description><pubDate>Thu, 21 Feb 2013 10:04:07 GMT</pubDate><dc:creator>sam-433147</dc:creator></item><item><title>RE: shellwait</title><link>http://www.sqlservercentral.com/Forums/Topic1422251-1291-1.aspx</link><description>[quote][b]sam-433147 (2/20/2013)[/b][hr]i run a Tsql query that move's a file from one computer to anotherset @sql='move '+@file1+' '+@file2EXEC master..xp_cmdshell  @sql , NO_OUTPUT now, i want the query to wait until the file arrive's to its destination and onlyif FileExists to continue the next actionis there something like shellwait until the xp_cmdshell  finish is job?thankssam[/quote]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.</description><pubDate>Thu, 21 Feb 2013 08:14:45 GMT</pubDate><dc:creator>opc.three</dc:creator></item><item><title>shellwait</title><link>http://www.sqlservercentral.com/Forums/Topic1422251-1291-1.aspx</link><description>i run a Tsql query that move's a file from one computer to anotherset @sql='move '+@file1+' '+@file2EXEC master..xp_cmdshell  @sql , NO_OUTPUT now, i want the query to wait until the file arrive's to its destination and onlyif FileExists to continue the next actionis there something like shellwait until the xp_cmdshell  finish is job?thankssam</description><pubDate>Wed, 20 Feb 2013 12:39:48 GMT</pubDate><dc:creator>sam-433147</dc:creator></item></channel></rss>