dbTalk Databases Forums  

Using DTS global var in a concatinating string

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


Discuss Using DTS global var in a concatinating string in the microsoft.public.sqlserver.dts forum.



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

Default Using DTS global var in a concatinating string - 10-06-2005 , 04:45 PM






Using a DTS package, I want to use a global variable to concatinate a string
for a table name I want to query. I then want to use the results as my
source for a data transfer task.

I'm trying to use something like....

declare @temp_id varchar(3)
declare @qry varchar(3000)
set @temp_id = ?
set @qry ='select distinct (specialty) as unknowns,
(spec_id) as specId from dbo.a_specialty'
+@temp_id+' where spec_id is null'
exec (@qry)

The source in a DTS Transform Data Task cannot read the SQL statement to
give me my results. Can anyone help out with what I may be able to do???

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

Default Re: Using DTS global var in a concatinating string - 10-06-2005 , 04:50 PM






Have a look here

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


Allan



"Steve" <Steve (AT) discussions (DOT) microsoft.com> wrote


Quote:
Using a DTS package, I want to use a global variable to concatinate a
string
for a table name I want to query. I then want to use the results as my
source for a data transfer task.

I'm trying to use something like....

declare @temp_id varchar(3)
declare @qry varchar(3000)
set @temp_id = ?
set @qry ='select distinct (specialty) as unknowns,
(spec_id) as specId from dbo.a_specialty'
+@temp_id+' where spec_id is null'
exec (@qry)

The source in a DTS Transform Data Task cannot read the SQL statement to
give me my results. Can anyone help out with what I may be able to
do???


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.