If you want to load data into SQL Server quickly, you can use the SQL Server statement BULK INSERT. The SQL Server ODBC driver lets you do BULK INSERTs from Linux and UNIX machines:
1,Apple 2,Orange 3,Plum 4,Pear
The example BULK INSERT statement in this article assumes the file is stored in the share \\192.168.0.27\myshare
$ cd /usr/local/easysoft/unixODBC/bin $ ./isql.sh -v MSSQL_DSN
Replace MSSQL_DSN with the name of your SQL Server ODBC data source. If your ODBC data source does not contain your SQL Server login details, include them in the isql command line. For example:
$ ./isql.sh -v MSSQL_DSN user pass
create table bulk_test ( testid integer, testname varchar(10) )
BULK INSERT bulk_test FROM '\\192.168.0.27\myshare\bulk.txt' WITH ( FIELDTERMINATOR = ',', ROWTERMINATOR = '\n' )
The Easysoft driver passes on the Transact-SQL, and so all the processing is done within SQL Server.
Further details of the BULK INSERT statement syntax can be found at http://msdn.microsoft.com/en-us/library/ms188365.aspx.