dbTalk Databases Forums  

Re: Global Variable Array to DDQ Parameter

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


Discuss Re: Global Variable Array to DDQ Parameter in the microsoft.public.sqlserver.dts forum.



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

Default Re: Global Variable Array to DDQ Parameter - 08-11-2003 , 09:46 AM






Worked like a champ...Thanks

Quote:
-----Original Message-----
Try a different approach

Build the statement in an Active Script task and assign
to the DDQ.

set the SourceSQLStatement of the DDQ to

"SELECT <col list> FROM table WHERE <col> IN " &
DTSGlobalVariables("ArrayOfVals").Value


What you are proposing initiallly would not work in TSQL
either

declare @a varchar(50)
set @a = '(''123'',''1124'')'
select * from authors where au_id in @a


--This would work though
declare @a varchar(100), @WholeString varchar(200)
set NOCOUNT On
set @a = '(''123'',''1124'')'
set @WholeString = 'SELECT * FROM Authors WHERE au_id
IN ' + @a
Exec(@WholeString)



--

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
.


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.