Last post Nov 27, 2007 06:50 PM by ndinakar
Nov 26, 2007 10:10 PM|rkchaudary|LINK
I am Ravi, I need a help.
My case is like.. i need to upload data from csv file into sql server 2005 data table.
but before that I need to check integrity of data
let us say csv data is like
here i have to check that, wether there is an entry in ISD codes table for 91 and 01 (india and us)
similarly AP , MC (Andhra Pradesh and MISSICippi)
please suggest me a nice approach, no of records in ISD codes and States will 350-450 records.
thanks in advance
Nov 27, 2007 01:41 AM|ndinakar|LINK
Load the CSV into a staging table (temporary table) and run the validity check. If everything is good, load the data into the actual tables.
Nov 27, 2007 06:40 AM|rkchaudary|LINK
How do i validate data which is present in the temporary table ?
is it using sql queries or any thing else ?
how is that, temp table is advised rather than sending a record at a time and getting it validated in a loop ?
Please clear my understanding ?
thanks for the reply Dinakar,
Nov 27, 2007 06:50 PM|ndinakar|LINK
Once the data is in a table, you need to use T-SQL to validate it withe xisting data. Whether you loop around and do one record at a time or do a batch validation depends on your business logic. Batch validation is preferred over looping as the former can
be faster when you have huge record sets.