all groups > sql server data warehouse > july 2004 >
You're in the

sql server data warehouse

group:

Confusion for loading data



Confusion for loading data Steve
7/26/2004 9:27:26 PM
sql server data warehouse: Hi,
I am building in a data mart using SQL server DTS. I have
confusion that

Example

Suppose we have text file for Cust table. It has 3
customers
A,
B,
C
This information comes in text file from legacy system.
We load this data in cust table in staging.

Now we get a new text file with 5 customers i.e
A,
B,
C,
D,
E.

What query shall I write to include the 2 new customers
i.e D & E in my Staging Table. How will I refer to text
file. Meaning that

select new_customers
from text file (what shall I write here to refer my text
file).

Or how is done.

If some one can solve this simple puzzle it will be great
help.

Thanks

Re: Confusion for loading data Jacco Schalkwijk
7/27/2004 12:50:55 PM
What I usually do is import the text file "as is" in a staging table and
manipulate the data from there. Tables are a lot easier to query than text
files.

You can get your new customers with a query similar to:

SELECT customer AS new_customer
FROM staging_table s
LEFT OUTER JOIN existing_table e
ON s.customer = e.customer
WHERE e.customer IS NULL

--
Jacco Schalkwijk
SQL Server MVP


[quoted text, click to view]

AddThis Social Bookmark Button