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 2000 Forums
 SQL Server Development (2000)
 CSV inport into temporary table

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-06-27 : 13:27:10
Daniel writes "I know you're going to say "we've written alot on CSV, try searching the site", as I've performed searches in both the Forum and the site, but nothing seem to answer my question, so I'm going to post it here and hope you might answer it for me.

I've got quite a hefty CSV file. Now I need to create a temporary table, and insert the whole file into this table. Sounds easy enough. I know I can use DTS, but I really want to work with a temp table, and not an actual one.

My CSV is like this:

///---------

Slight mix-up. My data is currently in an Excel Spreadsheet, and is proving very difficult to get into a decent CSV file (comma seperated) --- any ideas here also? I'll need the text to be enclosed within quotes.

My CSV will be like this :-)

"Surname", "First name", "Company Name", "Address 1", "Address 2", "Address 3", "Address 4", "PostalCode", "Contact type", "e-mail address", "Direct line"

and I just want to do a simple

INSERT INTO #tmpContacts (Surname, First_name, Company_Name, Address_1, Address_2, Address_3, Address_4, PostalCode, Contact_type, e-mail_address, Direct_line)
SELECT * FROM Contacts.txt

Is this possible?

Thanks,

Daniel Newman."
   

- Advertisement -