dbTalk Databases Forums  

DTS Package determine if table is Empty

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


Discuss DTS Package determine if table is Empty in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
gavincampbell_uk@yahoo.com
 
Posts: n/a

Default DTS Package determine if table is Empty - 10-04-2006 , 04:42 AM






Hi,

I have a dts package that i want to execute and I want to execute a
step as long as the table has records. If the table is empty then i
want the package to stop executing and notify.

Doing a select count(*) from tableName will give me the number of
records and if this is 0 then i know my table is empty but i cant seem
to get DTS to through this out as a failure as it parses the sql
statement as ok.

Any Ideas


Reply With Quote
  #2  
Old   
Nicolas Guinet
 
Posts: n/a

Default Re: DTS Package determine if table is Empty - 10-05-2006 , 09:53 AM






use a stored procedure to run you're package or create a new package with
some sql instructions

set @total = ...select count(*)...
if @total=0
execute dtspackage

Regards
Nicolas Guinet


<gavincampbell_uk (AT) yahoo (DOT) com> a écrit dans le message de news:
1159954959.548521.237330 (AT) m73g20...oglegroups.com...
Quote:
Hi,

I have a dts package that i want to execute and I want to execute a
step as long as the table has records. If the table is empty then i
want the package to stop executing and notify.

Doing a select count(*) from tableName will give me the number of
records and if this is 0 then i know my table is empty but i cant seem
to get DTS to through this out as a failure as it parses the sql
statement as ok.

Any Ideas




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 - 2013, Jelsoft Enterprises Ltd.