<?xml version="1.0" encoding="UTF-8"?><rss version="0.91" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><copyright>All content (copyright) respective authors</copyright><description>Code bookmark tagged with dts</description><link>http://www.codaddict.com/tag/dts</link><title>Code bookmark tagged with dts</title><item><title>DTS Error: Object not a collection</title><description>Instead of DTSGlobalVarialbes(&quot;gVar&quot;), put DTSGlobalVarialbes(&quot;gVar&quot;).Value</description><link>http://www.codaddict.com/vmonpara/SQL Server</link><dc:creator>vmonpara</dc:creator><pubDate>Mon, 13 Aug 2007 03:34:02 GMT</pubDate></item><item><title>DTS SQL Statement / Stored procedure / Function to check for existence of file.</title><description>CREATE FUNCTION [dbo].[fn_FileExists] (@FileName nvarchar(255))<br />
RETURNS bit AS  <br />
BEGIN <br />
	DECLARE @FS int<br />
	DECLARE @FileID int<br />
	DECLARE @OLEResult int<br />
	declare @Exists bit<br />
	<br />
	EXECUTE @OLEResult = sp_OACreate 'Scripting.FileSystemObject', @FS OUT<br />
	IF @OLEResult &lt;&gt; 0<br />
	BEGIN<br />
		RETURN 0<br />
	END<br />
	<br />
	EXECUTE @OLEResult = sp_OAMethod @FS, 'FileExists', @Exists OUT, @FileName<br />
	<br />
	IF @OLEResult &lt;&gt; 0<br />
	BEGIN<br />
		return 0<br />
	END<br />
	EXECUTE @OLEResult = sp_OADestroy @FS<br />
	<br />
	return @Exists<br />
<br />
END</description><link>http://www.codaddict.com/vmonpara/SQL Server</link><dc:creator>vmonpara</dc:creator><pubDate>Sun, 12 Aug 2007 08:16:31 GMT</pubDate></item><item><title>Stop DTS Package Execution Conditionally Without Failure</title><description>Dim fso, file1<br />
Dim pkg<br />
SET pkg = DTSGlobalVariables.Parent<br />
<br />
Set fso = CreateObject(&quot;Scripting.FileSystemObject&quot;)<br />
<br />
IF (fso.FileExists(&quot;c:\abc.txt&quot;)) THEN<br />
	Msgbox &quot;File exist. Continue&quot;<br />
	pkg.Steps(&quot;DTSStep_DTSActiveScriptTask_2&quot;).DisableStep=False<br />
	<br />
	Set fso= Nothing<br />
	<br />
ELSE<br />
	Msgbox &quot;Stop&quot;<br />
	pkg.Steps(&quot;DTSStep_DTSActiveScriptTask_2&quot;).DisableStep=True <br />
END IF<br />
set pkg=nothing<br />
Main = DTSTaskExecResult_Success</description><link>http://www.codaddict.com/vmonpara/SQL Server</link><dc:creator>vmonpara</dc:creator><pubDate>Sun, 12 Aug 2007 08:14:11 GMT</pubDate></item></channel></rss>