Import some csv column data into SQL Server 2008 R2 (programmatically) <p>I'd like to insert CSV data into a SQL Server database at one time. I know about <a href="http://stackoverflow.com/questions/14594072/importing-a-csv-file-using-bulk-insert-command-into-sql-server-table">BULK INSERT</a> but I <strong>need to select some fields only</strong>. So I try <code>INSERT INTO</code> like below -</p> <pre><code>try { OleDbConnection myOleDbConnection = new OleDbConnection("Provider=SQLOLEDB;Data Source=ServerName;Integrated Security=SSPI;Initial Catalog=DBName;User ID=sa;Password=password"); myOleDbConnection.Open(); string strSQL = null; strSQL = "INSERT INTO " + strTable + "(" + M_ItemCode + "," + M_ItemDesc + "," + M_UOM + ") " + "SELECT " + M_ItemCode + "," + M_ItemDesc + "," + M_UOM + " FROM [Text;DATABASE=E:\temp\\Item.csv]" ; OleDbCommand cmd = new OleDbCommand(strSQL, myOleDbConnection); return (cmd.ExecuteNonQuery() == 1); } catch (Exception ex) { Common.ShowMSGBox(ex.Message, Common.gCompanyTitle, Common.iconError); return false; } </code></pre> <p>I got the error </p> <blockquote> <p>Invalid object name 'Text;DATABASE=E:\temp\Item.csv'.</p> </blockquote> <p>Is my syntax wrong?</p>