dbTalk Databases Forums  

Execute DTS with Global variable

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Execute DTS with Global variable in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Kerr
 
Posts: n/a

Default Execute DTS with Global variable - 08-03-2005 , 11:09 AM






Hi all,
I am really new to DTS programming so I need some help.

I have a DTS package on my SQL Server with a dynamic property on it
which i want to use to specify the path of my source file.

HOW.. in code (VB.NET), do I execute my DTS package passing in a new
value for my dynamic property.
For argument lets say my variable in my DTS package is called
@strFilePath

Please help!!

I haven't written any code for this because I don't know where to start.

cheers

Kerr

*** Sent via Developersdex http://www.developersdex.com ***

Reply With Quote
  #2  
Old   
Paul
 
Posts: n/a

Default RE: Execute DTS with Global variable - 08-03-2005 , 11:42 AM






I do not use VB.NET, however, if you know how to pass a Command line in .NET
then use the following

DTSRUN /S YourServerSame /E /N"YourPackageName"
/A"YourGlobalVariable":8="@strFilePath"

Also @strFilePath just has to be a global variable – no need to add it to
dynamic properties.

The 8 refers to data type String. Search help for ‘DTSRUN Utility’ to get a
full listing of the data type values.

Ta
Paul

"Kerr" wrote:

Quote:
Hi all,
I am really new to DTS programming so I need some help.

I have a DTS package on my SQL Server with a dynamic property on it
which i want to use to specify the path of my source file.

HOW.. in code (VB.NET), do I execute my DTS package passing in a new
value for my dynamic property.
For argument lets say my variable in my DTS package is called
@strFilePath

Please help!!

I haven't written any code for this because I don't know where to start.

cheers

Kerr

*** Sent via Developersdex http://www.developersdex.com ***


Reply With Quote
  #3  
Old   
Kerr
 
Posts: n/a

Default RE: Execute DTS with Global variable - 08-03-2005 , 12:10 PM




Thanks for the reply.

When i try to run your code, i get an error.

saying incorrect syntax near "/".

which is unhelpful as there are two in the statement.

the line i parse to my command object is as follows
"DTSRUN /S servername /E /N"packagename"
/A"@strFilePath":8="c:\class_ref""

any idea

*** Sent via Developersdex http://www.developersdex.com ***

Reply With Quote
  #4  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Execute DTS with Global variable - 08-03-2005 , 02:01 PM



Why don't you let DTS take the work out of generating your DTSRUN string by
using DTSRUNUI?

Getting Syntax Help for DTSRun
(http://www.sqldts.com/default.aspx?301)

--



Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - You thought DTS was good. here we show you the new stuff.
www.konesans.com - Consultancy from the people who know


"Paul" <Paul (AT) discussions (DOT) microsoft.com> wrote

Quote:
I do not use VB.NET, however, if you know how to pass a Command line in
.NET
then use the following

DTSRUN /S YourServerSame /E /N"YourPackageName"
/A"YourGlobalVariable":8="@strFilePath"

Also @strFilePath just has to be a global variable - no need to add it to
dynamic properties.

The 8 refers to data type String. Search help for 'DTSRUN Utility' to get
a
full listing of the data type values.

Ta
Paul

"Kerr" wrote:

Hi all,
I am really new to DTS programming so I need some help.

I have a DTS package on my SQL Server with a dynamic property on it
which i want to use to specify the path of my source file.

HOW.. in code (VB.NET), do I execute my DTS package passing in a new
value for my dynamic property.
For argument lets say my variable in my DTS package is called
@strFilePath

Please help!!

I haven't written any code for this because I don't know where to start.

cheers

Kerr

*** Sent via Developersdex http://www.developersdex.com ***




Reply With Quote
  #5  
Old   
Kerr
 
Posts: n/a

Default RE: Execute DTS with Global variable - 08-04-2005 , 04:10 AM




Allen,
thanks for the reply however, in my first post I clearly stated that I
am new to dts programming so not too sure what to use. Plus I really do
need to initialise it from code because I have dynamic variables that I
need to pass from my code to the dts package.

Kerr


*** Sent via Developersdex http://www.developersdex.com ***

Reply With Quote
  #6  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Execute DTS with Global variable - 08-04-2005 , 03:26 PM



OK then you need to look at the object model if you want to use .Net.

Good places to start and learn are

http://www.sqldev.net/dts/DotNETCookBook.htm

DTS Global Variables and Visual Basic .Net
(http://www.sqldts.com/default.aspx?265)

--



Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - You thought DTS was good. here we show you the new stuff.
www.konesans.com - Consultancy from the people who know


"Kerr" <kerr_rk (AT) lycos (DOT) co.uk> wrote

Quote:
Allen,
thanks for the reply however, in my first post I clearly stated that I
am new to dts programming so not too sure what to use. Plus I really do
need to initialise it from code because I have dynamic variables that I
need to pass from my code to the dts package.

Kerr


*** Sent via Developersdex http://www.developersdex.com ***



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.