﻿<?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 2005 Integration Services  / Script task using batch file parameters / 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>Wed, 19 Jun 2013 15:40:22 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Script task using batch file parameters</title><link>http://www.sqlservercentral.com/Forums/Topic1406631-148-1.aspx</link><description>Great! Glad it worked out.  Thanks for the follow up.</description><pubDate>Mon, 14 Jan 2013 22:00:06 GMT</pubDate><dc:creator>Tim Mitchell</dc:creator></item><item><title>RE: Script task using batch file parameters</title><link>http://www.sqlservercentral.com/Forums/Topic1406631-148-1.aspx</link><description>Hi,heed your advice i did exactly, and it solved my problem, thanks:)</description><pubDate>Mon, 14 Jan 2013 19:40:05 GMT</pubDate><dc:creator>10e5x</dc:creator></item><item><title>RE: Script task using batch file parameters</title><link>http://www.sqlservercentral.com/Forums/Topic1406631-148-1.aspx</link><description>When building a package that allows the user the option of specifying a value for a date variable, I'll set the value of that variable to something unusual, such as 01/01/1899.  I'll then use a script task to check that variable to see if it is still set to the default, and if it is, I'll use the current date.  If the value is not set to the default, I can assume that a date value has been specified, and I'll use that instead.hth,Tim</description><pubDate>Mon, 14 Jan 2013 10:12:00 GMT</pubDate><dc:creator>Tim Mitchell</dc:creator></item><item><title>RE: Script task using batch file parameters</title><link>http://www.sqlservercentral.com/Forums/Topic1406631-148-1.aspx</link><description>I met with another problem. Lets say using the same package variable ExecDate, data type : String, Default value : "Default"So if my batch file pass a date parameters to the variable it will used the date pass, else it shall use today date and not the value "Default". How to do this in a Execute SQL task? I got a statement of [code="sql"]Delete From T1 Where creationDate = ? [/code]This wont work as i wont want the value "Default". Any advice? My column creationDate is of datetime typethanks</description><pubDate>Mon, 14 Jan 2013 07:58:01 GMT</pubDate><dc:creator>10e5x</dc:creator></item><item><title>Script task using batch file parameters</title><link>http://www.sqlservercentral.com/Forums/Topic1406631-148-1.aspx</link><description>Hi all,I have created a batch file to run my SSIS package. I will be able to pass parameters in my batch file such as 20121228 (YYYYMMDD format) I have created a package variable named ExecDate of string type in SSIS. And inside script task i have a line of code as:[code="vb"]Dim runDate As DateTime = Now[/code]now instead of declaring runDate as current datetime, i would like to change it to if ExecDate = "Default", runDate = Nowelse runDate = to the parameter i passed in the batch file. Note: my ExecDate is of String datatypeThanks in advance, pros please helpupdate: i think i have solve the above problem by advising user to only pass in parameters of 2012/12/28 format and using a CDATE function to convert it to date.</description><pubDate>Mon, 14 Jan 2013 03:13:05 GMT</pubDate><dc:creator>10e5x</dc:creator></item></channel></rss>