x
login about faq Site discussion (meta-askssc)

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 '11 at 05:50 AM in Default

Leks gravatar image

Leks
11 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 '11 at 08:09 AM

ThomasRushton gravatar image

ThomasRushton ♦
29.2k 6 9 36

(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. 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

more ▼

answered Jul 07 '11 at 08:14 AM

ThomasRushton gravatar image

ThomasRushton ♦
29.2k 6 9 36

(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



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x62
x47
x9
x2

asked: Jul 07 '11 at 05:50 AM

Seen: 392 times

Last Updated: Jul 07 '11 at 05:50 AM

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.