connect to SQL server from shell script

Hi all,

I need to connect to SQL server from shell script. Then need to execute queries from shell script as below

  1. To compare values of an array with SQL table's entry.

I am using solaris-5.1 to run shell script and want to connect to SQL-5.1 which is installed on SantOS.

Kindly let me know on how to do this

Thanks,

No need for double posting!

There is free JDBC tool JISLQ from xigole that, with free JDBC JARs from MS, gives you command line access.

The unixodbc project has an isql tool, and can hook to freeTDS odbc in UNIX/LINUX.

The freeTDS project has both isql and freebcp tools.

The Sybase isql probably works with SQL Server, because guess where MS bought their database, that they added GUIs and other MS flavored config bits to?

MS SQL Server may have isql command line tools, too, maybe even free to server license holders.

Now, once you have the data out, convert it to tab separated trimmed text using sed or the language of your choice, sort both files, and compare using 'comm'.

hi DGPickett,
Thanks for a quick reply.

Can you please explain it in steps....it's bit confusing for a beginner like me ??
I'll be great if you can share links as well.

Cheers
Amit

I mentioned JAVA first, as it is portable and free and can be mostly for MS. What is your client?

Jisql - a Java based interactive SQL application
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=a737000d-68d0-4531-b65d-da0f2a735707&displaylang=en
FreeTDS.org
jTDS JDBC Driver
http://www.unixodbc.org/doc/FreeTDS.html

Google is our memory! BTW, for GUI, I use SQuirreL JDBC on everything.