dbTalk Databases Forums  

check for data existence in Transformation Task

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


Discuss check for data existence in Transformation Task in the microsoft.public.sqlserver.dts forum.



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

Default check for data existence in Transformation Task - 10-06-2004 , 10:10 PM






In DTS, i would like to identify whether the Alliance table has data,
if has data, then i want to extract the relevant data from another
table called Boolean. After i run the following code, it will return
an error message : Invalid pointer.

if not exists (select * from Alliance)

SELECT catalog_code, category_code, status, supplier_id, description,
start_date, end_date, points_value, supplier_ref, cash_value
FROM Boolean
where len(catalog_code) = 15

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

Default Re: check for data existence in Transformation Task - 10-07-2004 , 12:02 AM






Try this in your SQL Task:

if not exists(select * from Alliance)
begin
SELECT catalog_code, category_code, status, supplier_id, description,
start_date, end_date, points_value, supplier_ref, cash_value
FROM Boolean
where len(catalog_code) = 15;
end;

Regards,
Ilona Shulman
Senior Development Consultant, DBA
SSE Inc
http://www.sseinc.com


"tchangmian" <tchangmian (AT) yahoo (DOT) com.sg> wrote

Quote:
In DTS, i would like to identify whether the Alliance table has data,
if has data, then i want to extract the relevant data from another
table called Boolean. After i run the following code, it will return
an error message : Invalid pointer.

if not exists (select * from Alliance)

SELECT catalog_code, category_code, status, supplier_id, description,
start_date, end_date, points_value, supplier_ref, cash_value
FROM Boolean
where len(catalog_code) = 15



Reply With Quote
  #3  
Old   
tchangmian
 
Posts: n/a

Default Re: check for data existence in Transformation Task - 10-08-2004 , 02:53 AM



It also didn't worked and come out with the same error.
Actually what i want is when there is no data exist in table Alliance,
then this step(Transformation Task) will run and transform the data
from Boolean to Alliance. While if table Alliance consist of data
already, then this step will run also but do nothing, and also do not
come out an error message. What can i do?
Thanks


"ilona" <ieshulman (AT) sseinc (DOT) com> wrote

Quote:
Try this in your SQL Task:

if not exists(select * from Alliance)
begin
SELECT catalog_code, category_code, status, supplier_id, description,
start_date, end_date, points_value, supplier_ref, cash_value
FROM Boolean
where len(catalog_code) = 15;
end;

Regards,
Ilona Shulman
Senior Development Consultant, DBA
SSE Inc
http://www.sseinc.com


"tchangmian" <tchangmian (AT) yahoo (DOT) com.sg> wrote in message
news:6447ee25.0410061910.12207ae4 (AT) posting (DOT) google.com...
In DTS, i would like to identify whether the Alliance table has data,
if has data, then i want to extract the relevant data from another
table called Boolean. After i run the following code, it will return
an error message : Invalid pointer.

if not exists (select * from Alliance)

SELECT catalog_code, category_code, status, supplier_id, description,
start_date, end_date, points_value, supplier_ref, cash_value
FROM Boolean
where len(catalog_code) = 15

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.