dbTalk Databases Forums  

Populating a global variable.....

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


Discuss Populating a global variable..... in the microsoft.public.sqlserver.dts forum.



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

Default Populating a global variable..... - 12-22-2004 , 10:03 PM






How to populate a global variable by reading the data from a database.
Basically I want to find out the max date from a field and poulate the
variable.
SQL2K.
Thanks
Brian



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

Default Re: Populating a global variable..... - 12-23-2004 , 01:00 AM






Use an ExecuteSQL task

Statement would be

SELECT MAX(whatever) as MaxValue FROM Table

Hit the Parameters button | Output Parameters | Row Value

In the grid at the bottom you can then map MaxValue to a Global Variable


--



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


"John Brian" <JohnBrian77 (AT) hotmail (DOT) com> wrote

Quote:
How to populate a global variable by reading the data from a database.
Basically I want to find out the max date from a field and poulate the
variable.
SQL2K.
Thanks
Brian





Reply With Quote
  #3  
Old   
John Brian
 
Posts: n/a

Default Re: Populating a global variable..... - 12-23-2004 , 10:01 PM



Thanks.
It helped.
John


"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote

Quote:
Use an ExecuteSQL task

Statement would be

SELECT MAX(whatever) as MaxValue FROM Table

Hit the Parameters button | Output Parameters | Row Value

In the grid at the bottom you can then map MaxValue to a Global Variable


--



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


"John Brian" <JohnBrian77 (AT) hotmail (DOT) com> wrote in message
news:%23Q6g%23TK6EHA.2592 (AT) TK2MSFTNGP09 (DOT) phx.gbl...
How to populate a global variable by reading the data from a database.
Basically I want to find out the max date from a field and poulate the
variable.
SQL2K.
Thanks
Brian







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.