dbTalk Databases Forums  

Global Variables in DTS package?

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


Discuss Global Variables in DTS package? in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
shop@pacifictabla.com
 
Posts: n/a

Default Global Variables in DTS package? - 01-13-2005 , 03:42 PM






Hi:

I want to use a global variable setting in Data Pump Tasks and Execute
SQL Tasks. Is there a way to do this other than using a '?' in the
WHERE clause? i.e. I want to use the variable in the SELECT part of the
SELECT statement. So something like this (which isn't possible):

SELECT ? AS BeginningDate, Field 1, Field 2
FROM TestTable
_____________

Thanks!
Kayda


Reply With Quote
  #2  
Old   
Darren Green
 
Posts: n/a

Default Re: Global Variables in DTS package? - 01-13-2005 , 05:21 PM






In message <1105652525.632737.313920 (AT) f14g2000cwb (DOT) googlegroups.com>,
shop (AT) pacifictabla (DOT) com writes
Quote:
Hi:

I want to use a global variable setting in Data Pump Tasks and Execute
SQL Tasks. Is there a way to do this other than using a '?' in the
WHERE clause? i.e. I want to use the variable in the SELECT part of the
SELECT statement. So something like this (which isn't possible):

SELECT ? AS BeginningDate, Field 1, Field 2
FROM TestTable
_____________

Thanks!
Kayda


That should work. As a rule if you can use a variable in T-SQL then you
can use a place holder in DTS. Sometimes the design-time validation is
too strict but you can fudge it. Use some SQL that has the same
meta-data (variable setup), but then change it via Disco Edit.

An example of this fudge is described towards the end of this article-

Global Variables and Stored Procedure Parameters
(http://www.sqldts.com/default.aspx?234)


--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com

PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org



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.