Basically I want to write all the lines of a text file present in linux machine to Microsoft SQL server database. I need a shell script to connect from my Linux machine to a remote Microsoft SQL Server (2008) database and do insertion. How do I do this?
AFAIK, MSSQL Server is a modified version of a SyBase RDBMS.
At least with MSSQL 2005, the SyBase tools worked for MSSQL as well. It may still be the case with MSSQL 2008.
Look for FreeTDS, a free implementation for accessing such servers.
It comes with
If I understand correctly, you want to import the contents of a text file on a Unix or Linux OS in a SQL Server database. The first thing that comes to mind is that Unix/Linux and Windows use different characters for newlines, so a utility like dos2unix might be useful. Second, why not just use scp to copy the file to the SQL Server machine and import? Third, you're asking for trouble IMHO.