dbTalk Databases Forums  

Global Variables and Subqueries Problem

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


Discuss Global Variables and Subqueries Problem in the microsoft.public.sqlserver.dts forum.



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

Default Global Variables and Subqueries Problem - 09-10-2003 , 11:29 AM







Hi, I'm having this problem when running a query that contains a
subquery with parameters.



SELECT A.*

FROM A (NOLOCK)

WHERE columnA >= GETDATE() - ?



UNION



SELECT B.*

FROM B (NOLOCK)

WHERE columnB >= GETDATE() - ?

AND columnB2 NOT IN (SELECT columnD FROM D (NOLOCK) WHERE columnD >=
GETDATE() - ?)





The 2 global variables are declared in design mode, and changed in an
ActiveX Script VBScript Code.



Anybody knows what's going on ?



Thanks


--
Posted via http://dbforums.com

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

Default Re: Global Variables and Subqueries Problem - 09-10-2003 , 12:49 PM






In article <3353561.1063211367 (AT) dbforums (DOT) com>, arielbvargas
<member38981 (AT) dbforums (DOT) com> writes
Quote:
Hi, I'm having this problem when running a query that contains a
subquery with parameters.
<snip>

Quote:
The 2 global variables are declared in design mode, and changed in an
ActiveX Script VBScript Code.

Anybody knows what's going on ?
Unfortunately the OLE-DB parameter functions as used by DTS just does
not support some things such as sub-queries and unions.

When I hit this issue I go back to a simple string manipulation method,
and skip the DTS parameter functionality entirely, just like the good
old days with SQL 7.0

Global Variables and SQL statements in DTS
(http://www.sqldts.com/default.aspx?205)


--
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.