dbTalk Databases Forums  

Global variable/look-up ???

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


Discuss Global variable/look-up ??? in the microsoft.public.sqlserver.dts forum.



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

Default Global variable/look-up ??? - 07-15-2003 , 04:32 PM






I need to use the result of MAX(date_XX)in connection 2 in
the "where" clause of connection 1.

From what I've read I can either us a global variable or a
look-up.

Documentation is very unclear (or just difficult for me to
understand). Can any of you kind people suggest which one
is best and provide a sample instructions.

Thank you in advance!

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

Default Re: Global variable/look-up ??? - 07-16-2003 , 11:21 AM






Thanks for the information.

I have set up the Exec SQL task and created the Global
variable with the output result.

When I go to set up the input parameter to make the
variable available, I receive an error message when I
click on the parameter button on the source tab of the
data pump.

That connection i am using a Sybase ODBC connection. The
mssage I am getting is :

"Microsoft OLEDB provider for ODBC driver."

"Provider can not derive parameter information and
serparameterinfo has not been called."

Any help would be appreciated.


Quote:
-----Original Message-----
Are you using SQL Server 2000 ?

If yes then you can use an ExecuteSQL task to assign a
select statement's
output to a Global Variable. You can then reuse that
elsewhere in your
package

--

----------------------------
Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org



"Gary" <gconte (AT) optonline (DOT) net> wrote in message
news:0c1801c34b18$a1bb97b0$a001280a (AT) phx (DOT) gbl...
I need to use the result of MAX(date_XX)in connection 2
in
the "where" clause of connection 1.

From what I've read I can either us a global variable
or a
look-up.

Documentation is very unclear (or just difficult for me
to
understand). Can any of you kind people suggest which
one
is best and provide a sample instructions.

Thank you in advance!


.


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

Default Re: Global variable/look-up ??? - 07-16-2003 , 02:10 PM



Ahhhhhhhhh

Perhaps your driver does not allow parameters

What is the statement you are using ?

You still have a few choices.

1. To feed a GV

DataPump task - Source = Your Statement - Destination = do not choose
anything but add an AX Transform. In your script it will look something
like

DTSGlobalVariables("GV").Value = DTSSource("MyField")


2. To use the GV

You can use an Active Script task to create the statement for the ExecuteSQL
Statement rather like

Global Variables and SQL statements in DTS
http://www.sqldts.com/default.aspx?6,102,205,7,1

--

----------------------------
Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org



"Gary" <gary.conte (AT) am (DOT) sony.com> wrote

Quote:
Thanks for the information.

I have set up the Exec SQL task and created the Global
variable with the output result.

When I go to set up the input parameter to make the
variable available, I receive an error message when I
click on the parameter button on the source tab of the
data pump.

That connection i am using a Sybase ODBC connection. The
mssage I am getting is :

"Microsoft OLEDB provider for ODBC driver."

"Provider can not derive parameter information and
serparameterinfo has not been called."

Any help would be appreciated.

-----Original Message-----
I would do it like this-
Exec SQL Task on Conn 1
SELECT MAX(Date_XX) FROM ...
Use an output parameter Row value to store this result
into a global
variable.

In the DataPump source query use an Input parameter to
use the variable
value-

SELECT * FROM Table WHERE DateCol = ?


You would not use Lookups here, they are only available
within a
transformation script.


--
Darren Green
http://www.sqldts.com

"Gary" <gconte (AT) optonline (DOT) net> wrote in message
news:0c1801c34b18$a1bb97b0$a001280a (AT) phx (DOT) gbl...
I need to use the result of MAX(date_XX)in connection 2
in
the "where" clause of connection 1.

From what I've read I can either us a global variable
or a
look-up.

Documentation is very unclear (or just difficult for me
to
understand). Can any of you kind people suggest which
one
is best and provide a sample instructions.

Thank you in advance!


.




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.