Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Getting Distinct Values From Txt File

Author  Topic 

rickjackson
Starting Member

1 Post

Posted - 2008-09-03 : 10:19:39
Hello I Have a Problem I Want Some Logic The Whole Scenario is
I Have a Table and a txt file and txt file contains 76000 records
what i want to do is i want the distinct values from a column which is in a txt file so i can delete Specific the records from the table which i got from the txt File so Sugges Me Any Logic Thanks

Vinnie881
Master Smack Fu Yak Hacker

1231 Posts

Posted - 2008-09-03 : 11:45:23
Working with a text file is never ideal when you have large record counts. I would import the text file into a sql table (There are many examples online), then perform your "Distinct" logic.

[i.e.]

delete a from MyTable a inner Join MyTextFileTable b on a.MyCol = b.MyCol
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-09-03 : 12:56:15
After you load staging table from text file,you can use this logic:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=109666
Go to Top of Page
   

- Advertisement -