dbTalk Databases Forums  

Lookup Table

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


Discuss Lookup Table in the microsoft.public.sqlserver.dts forum.



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

Default Lookup Table - 07-15-2003 , 03:32 AM






I have text file which will be inputted to the SQL
table. How can I check if the row is already existing in
the SQL table (the
first column is the key) so I do not need to add the
record (from the text file) to the table since there is an
existing value. What
is the best way to do a lookup before inserting a record
(read from a text file). Thanks.


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

Default Re: Lookup Table - 07-15-2003 , 03:39 AM






Personally I would BULK INSERT the text file into a staging area and then
use TSQL to compare the records

--

----------------------------
Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org



"Elgar Esteban" <elgaresteban (AT) hotmail (DOT) com> wrote

Quote:
I have text file which will be inputted to the SQL
table. How can I check if the row is already existing in
the SQL table (the
first column is the key) so I do not need to add the
record (from the text file) to the table since there is an
existing value. What
is the best way to do a lookup before inserting a record
(read from a text file). Thanks.




Reply With Quote
  #3  
Old   
Elgar Esteban
 
Posts: n/a

Default Re: Lookup Table - 07-15-2003 , 10:18 PM



So I do some sort of a Data Transformation in a temporary
SQL table and then do the Bulk Insert task after that?

Will there be a performance problem if there are many
records to be processed?

Quote:
-----Original Message-----
Personally I would BULK INSERT the text file into a
staging area and then
use TSQL to compare the records

--

----------------------------
Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org



"Elgar Esteban" <elgaresteban (AT) hotmail (DOT) com> wrote in
message
news:02d401c34aab$9baa7b10$a001280a (AT) phx (DOT) gbl...
I have text file which will be inputted to the SQL
table. How can I check if the row is already existing in
the SQL table (the
first column is the key) so I do not need to add the
record (from the text file) to the table since there is
an
existing value. What
is the best way to do a lookup before inserting a
record
(read from a text file). Thanks.



.


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.