Re: Using global variable in DTS packages
From: Allan Mitchell (allan_at_no-spam.sqldts.com)
Date: 07/19/04
- Previous message: Paul: "Re: Update Table with DTS"
- In reply to: Ravi: "Using global variable in DTS packages"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 19 Jul 2004 07:12:14 +0100
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@discussions.microsoft.com> wrote in message news:2e86b01c46d54$355e9d10$a601280a@phx.gbl... > 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.
- Previous message: Paul: "Re: Update Table with DTS"
- In reply to: Ravi: "Using global variable in DTS packages"
- Messages sorted by: [ date ] [ thread ]