x

SQL Server 2000 DTS

Hi, I want to pass in a variable from my T-SQL and use it as a parameter in my Dynamic task properties task. is this possible? I am trying to pass in my parameter this way xp_cmdShell 'dtsrun /works /works/works/NworksTEST_global /A cValue:8=E'

I want to use the ComposValue in the Dynamic Properties Task - something like - Select * from [table] where c = DTSGlobalVariables("ComposValue").Value

Is this possible? Is there another approach I need to be looking at instead?

Thanks!
more ▼

asked Jul 07, 2011 at 05:50 AM in Default

Leks gravatar image

Leks
11 1 1 1

(comments are locked)
10|1200 characters needed characters left

2 answers: sort voted first
An alternative approach would be to have that value put in a specific place in the database (ie a table) just before you call dtsrun, and then alter the DTS script to pull the value out of the table before passing it to your Dynamic properties task...
more ▼

answered Jul 07, 2011 at 08:09 AM

ThomasRushton gravatar image

ThomasRushton ♦
34.2k 18 20 44

(comments are locked)
10|1200 characters needed characters left

OK. According to my SQL 2000 DTS book, you need to use the format:

DTSRUN /A "VariableName":"DataTypeID"="Value"

The quotes are required. See also [MSDN on DTSRun][1]. There are a couple of caveats in that link.

If you want to build a sample command line to see what it should look like, try running DTSRUNUI

[1]: http://msdn.microsoft.com/en-us/library/aa224467(v=sql.80).aspx
more ▼

answered Jul 07, 2011 at 08:14 AM

ThomasRushton gravatar image

ThomasRushton ♦
34.2k 18 20 44

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x66
x51
x9
x3

asked: Jul 07, 2011 at 05:50 AM

Seen: 769 times

Last Updated: Jul 07, 2011 at 05:50 AM