SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Development Tools
 Other Development Tools
 CLR Stored Proc - reading a csv file into SQL
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

theboyholty
Posting Yak Master

United Kingdom
221 Posts

Posted - 12/23/2011 :  08:32:46  Show Profile  Visit theboyholty's Homepage  Reply with Quote
I'm very new to vb.net although fairly experienced in SQL. I'm trying to find a quick and robust way of reading the contents of a csv file into a SQL table so my first question is simply, Can it be done?

I've so far user IO.File.ReadAllText to read the contents of the file into a variable, now I need to know how to get the contents of that variable to do something useful.



---------------------------------------------------------------------------------
http://www.mannyroadend.co.uk A Bury FC supporters website and forum

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 12/23/2011 :  10:48:12  Show Profile  Reply with Quote
it can be done using multiple methods like Export/Import wizard , OPENROWSET etc

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

robvolk
Most Valuable Yak

USA
15659 Posts

Posted - 01/01/2012 :  08:51:29  Show Profile  Visit robvolk's Homepage  Reply with Quote
There's also the bcp utility and the BULK INSERT command. Unless you have to deal with embedded quotes, commas, or line feeds, these are typically easier and faster to import.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000