dbTalk Databases Forums  

DTS Insert Checking Current Records

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


Discuss DTS Insert Checking Current Records in the microsoft.public.sqlserver.dts forum.



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

Default DTS Insert Checking Current Records - 11-23-2006 , 10:25 AM






Hi there

I have a DTS package that will take records from a log file, insert
them into a staging table, which is a real table in SQL. Then I want to
insert these records into another results table which is a table to be
used in a web application. How do I check, without using a cursor, if
the records exist in the results table when inserting them, as the
insert would be like

Insert into results( fields)

Select (fields) from staging

Where condition

The results table is not part of the select so the table name is not
recognised, which is right. I would rather not use a cursor, I was
thinking of even rather truncating the tables in the DTS rather than
use a cursor, as I thought this might be less overhead, but would this
be a problem on the web side if the DTS was running say every 15 mins
or something like that, would the user be affected, I will be writing
the web app in C#' so using dataset so the data will be in memory, this
should get around the worry of users hitting the database all the time
and the table being truncated. Or is this not the right way to do this.


Any advice welcome.

Cheers

J


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

Default Re: DTS Insert Checking Current Records - 11-23-2006 , 01:47 PM






Hello Jenbo,


Ok So you load a log file into an intermediate table and then go from the
intermediate table to a real table. The intermediate table to real table
needs to check to see if the record exists already.

Have a look at a LEFT OUTER JOIN matching on the keys and looking for a NULL
in the key value for the table on the right hand side of the join which in
this case is the real table.


Regards

Allan Mitchell
Konesans Ltd
T +44 7966 476 572
F +44 2071 008 479
http://www.konesans.com

Quote:
Hi there

I have a DTS package that will take records from a log file, insert
them into a staging table, which is a real table in SQL. Then I want
to insert these records into another results table which is a table to
be used in a web application. How do I check, without using a cursor,
if the records exist in the results table when inserting them, as the
insert would be like

Insert into results( fields)

Select (fields) from staging

Where condition

The results table is not part of the select so the table name is not
recognised, which is right. I would rather not use a cursor, I was
thinking of even rather truncating the tables in the DTS rather than
use a cursor, as I thought this might be less overhead, but would this
be a problem on the web side if the DTS was running say every 15 mins
or something like that, would the user be affected, I will be writing
the web app in C#' so using dataset so the data will be in memory,
this should get around the worry of users hitting the database all the
time and the table being truncated. Or is this not the right way to do
this.

Any advice welcome.

Cheers

J




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.