# Connect to MSSQL

## anpe

Hi. I have to connect to a MSSQL-server, from my shell-scripts. On my old server I use sqsh, but it's not present in portage anymore. Can anyone help me out. Is there any substitute for sqsh. Or is it possible to install sqsh from scratch. Suggestions.

----------

## gerdesj

I've never heard of sqsh so used a well known search engine.

According to the 'buntu package description:

"sqsh is a flexible commandline utility that uses the freetds libraries to connect to Sybase or Microsoft SQL servers. It is a useful debugging tool for identifying problems with other SQL applications, and it can be used as a productivity tool in its own right: unlike most SQL CLIs, sqsh's interactive shell lets you pipe the output of SQL queries directly to other Unix commands for further processing."

I suggest you use mysql (ie the command line client) to connect to MySQL databases.  I find it pretty complete.

Perhaps your query belongs in another forum - this is Networking and Security.

Cheers

Jon

----------

## anpe

Well I´m not  sure in what forum to put it, if not networking-suggestions.

 The question was not connect to mysql, but MSSQL - Microsoft SQL. I want  to ask SQL-query´s from a script.

----------

## stuNNed2

# eix -HAS mssql

* dev-java/jdbc-mssqlserver

     Available versions:  

	(0)	2.2.0040-r1!m

	(2005)	2005.1.2.2828.100!m

	{doc elibc_FreeBSD}

     Homepage:            http://www.microsoft.com/downloads/details.aspx?familyid=07287b11-0502-461a-b138-2aa54bfdc03a&displaylang=en

     Description:         JDBC driver for Microsoft SQL Server 2005

* dev-php/PEAR-MDB2_Driver_mssql

     Available versions:  1.2.1 1.3.0_alpha1 1.3.0_alpha2 (~)1.3.0_beta1 (~)1.3.0_beta2

     Homepage:            http://pear.php.net/MDB2_Driver_mssql

     Description:         Database Abstraction Layer, mssql driver

* dev-python/pymssql

     Available versions:  1.0.2

     Homepage:            http://pymssql.sourceforge.net/ http://code.google.com/p/pymssql/ http://pypi.python.org/pypi/pymssql

     Description:         Simple MSSQL python extension module

Found 3 matches.

hth

----------

## stuNNed2

the latter are scripts, but python 2.0 based.

----------

## patrix_neo

I tried google for a replacement, but ended up with isql which is a part of unixODBC package. May that be enough as a replacement?

Unless you are not adventureous enough to use a non-portage package for sqsh that is

----------

## nativemad

I personally use isql from within bash-scripts... works great for me!  :Smile: 

----------

## anpe

isql sounds promissing. Also sounds familiar - something I may have used on a SOLARIS station years ago. When I wrote script, I ment shell-script (bash-script). So isql sounds like my solution. 

 What is the package to install, to get isql? Is it a package of its own?

----------

## nativemad

Isql is within dev-db/unixODBC.

----------

