dbTalk Databases Forums  

Using global variable in DTS packages

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


Discuss Using global variable in DTS packages in the microsoft.public.sqlserver.dts forum.



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

Default Using global variable in DTS packages - 07-19-2004 , 12:49 AM






Please help me as I am new to DTS programming in SQL
Server 2000. I am moving data between different servers in
SQL 2000. I am running a visual basic 6.0 application and
want to use a DTS package by passing a global variable (in
DTS) to insert a complete recordset into another database
(in sql server). This global variable will take a value of
public variable in visual basic (a numerical value) and
copy a complete recordset from one sql server database
based upon this public variable numerical value (for
example, an account number) and insert it into another sql
database.

Please let me know if there is a better way of doing what
I am trying to accomplish or help me. Cheers.

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

Default Re: Using global variable in DTS packages - 07-19-2004 , 01:12 AM






OK

You can do this a multitude of ways seeing as you are using VB

I presume you are using the DataPump task and that the destination and
source definitions are the same simply you want to move details for one
account number at one time and a different account number another

If this is tru then your datapump task should look something like this as a
source

SELECT <col list> FROM TABLE WHERE Account_Number = ?

You then map, using the parameters button a Global Variable onto the ?

The choice is in how you supply the Global Variable Value.

1. Use the Object Model and supply the value to the GlobalVariable of your
choice
2. Call DTSRUN and use the /A switch
3. In your package use the Dynamic Properties task and have the package
read from an external source. Your VB then just fires the package.

Have a look at our site for help (www.sqldts.com)

Especially

Global Variables and SQL statements in DTS
(http://www.sqldts.com/Default.aspx?205)

and

Execution
(http://www.sqldts.com/Default.aspx?104)



--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.konesans.com - Consultancy from the people who know


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

Quote:
Please help me as I am new to DTS programming in SQL
Server 2000. I am moving data between different servers in
SQL 2000. I am running a visual basic 6.0 application and
want to use a DTS package by passing a global variable (in
DTS) to insert a complete recordset into another database
(in sql server). This global variable will take a value of
public variable in visual basic (a numerical value) and
copy a complete recordset from one sql server database
based upon this public variable numerical value (for
example, an account number) and insert it into another sql
database.

Please let me know if there is a better way of doing what
I am trying to accomplish or help me. Cheers.



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.