Unix/Linux Go Back    


Shell Programming and Scripting Unix shell scripting - KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and shell scripts and shell scripting languages here.

connect to SQL server from shell script

Shell Programming and Scripting


Closed Linux or Unix Question    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 12-15-2010
amitbhelave amitbhelave is offline
Registered User
 
Join Date: Dec 2010
Last Activity: 15 December 2010, 9:04 AM EST
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
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,
Sponsored Links
    #2  
Old Unix and Linux 12-15-2010
DGPickett DGPickett is offline Forum Advisor  
Registered User
 
Join Date: Oct 2010
Last Activity: 17 February 2015, 1:56 PM EST
Location: Southern NJ, USA (Nord)
Posts: 4,671
Thanks: 8
Thanked 586 Times in 559 Posts
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'.
Sponsored Links
    #3  
Old Unix and Linux 12-15-2010
amitbhelave amitbhelave is offline
Registered User
 
Join Date: Dec 2010
Last Activity: 15 December 2010, 9:04 AM EST
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
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
    #4  
Old Unix and Linux 12-15-2010
DGPickett DGPickett is offline Forum Advisor  
Registered User
 
Join Date: Oct 2010
Last Activity: 17 February 2015, 1:56 PM EST
Location: Southern NJ, USA (Nord)
Posts: 4,671
Thanks: 8
Thanked 586 Times in 559 Posts
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/e...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.
Sponsored Links
Closed Linux or Unix Question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
connect to SQL server from shell script ananthi_ku Shell Programming and Scripting 1 09-28-2010 04:38 AM
Shell Script to connect to another server and copying files incepted Shell Programming and Scripting 2 07-24-2010 06:47 AM
How to write a shell script to connect to another server? Angelo Programming 12 04-29-2010 01:34 AM
shell script for how to connect to a remote server by using ssh millan Shell Programming and Scripting 1 01-24-2009 09:17 AM
ftp script not able to connect to ftp server. gram77 Shell Programming and Scripting 3 02-16-2008 01:44 PM



All times are GMT -4. The time now is 09:22 PM.