dbTalk Databases Forums  

Transform data from a temp table

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


Discuss Transform data from a temp table in the microsoft.public.sqlserver.dts forum.



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

Default Transform data from a temp table - 09-10-2004 , 05:32 AM







I created a simple transform using SQL Query with (very roughly sampled)
the query below.
Basically I use a temp table, and am outputting the results to a text file -
not too difficult.

However, I need to make an amendment to the SQL Query but now when I click
on the "Transformations" table, the columns on the left are gone.

Initially I thought that using a temp table would cause me problems, but it
worked fine.
When I preview the results, it shows up correctly, I can also define columns
on the destination tab..

What did I do differently to allow the transformation to work when I created
it....???!!

Thanks
Ben






-----------------------------------------
--- sample SQL Query code from "Source" in DTS data transform
-----------------------------------------


-- create temp table
create table #Product (
prod_id
description )

-- insert rows from perm table
inert into #Product ( prod_id, description )
select prod_id, description
from Product
where bla bla

-- remove commas from the description (in pseudocode for the purposes of
this post)
declare @comma_count
select @comma_count = count(*) from #Product where charindex( ',' ,
description) > 0


while @comma_count > 0
begin
update #Product
set desription = left() + right() <-- you know what I mean
where charindex(comma position) > 0
select @comma_count = @@rowcount
end

-- results set for DTS transform
select prod_id, description from #Product




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

Default Re: Transform data from a temp table - 09-10-2004 , 07:44 AM







"Beema" <none (AT) supplied (DOT) com> wrote

Quote:
I created a simple transform using SQL Query with (very roughly sampled)
the query below.
Basically I use a temp table, and am outputting the results to a text
file -
[snippped]
Quote:

Actually I found that pressing the Preview button twise has fixed it.

The second time I get an error saying "The table #Product already exists",
but it fixes the problem I dsescribed.

Way hay!




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.