Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to connect to MSsql server using perl

Status
Not open for further replies.

thendal

Programmer
Aug 23, 2000
284
Hi all! Some one direct me what modules i need to install to work with mssql server. I already have DBI worked with mysql. now i need to work with mssql.

I can't find a driver for mssql server. I am pretty sure its out there.
i am trying to install it from freebsd machine.

any help will be much appreciated.

Thanks,

 
You won't find a free driver for MSSQL since MS is not open source. The Sybase::DBD driver will work for most basic commands like select, insert, etc.

Good Luck and READ THE DOCS!
 
Thanks Lawn, I got the DBD::Sybase driver installed.
Before that i installed freetds.

update later. Any other heads up will help.






 
I installed DBD::Sybase, freetds

when i ran my script

use DBI;
BEGIN {
$ENV{'SYBASE'} = '/usr/local/freetds';
$ENV{'TDSVER'} = 7.0;
}
$dbh = DBI->connect("dbi:Sybase:server=10.0.0.1", "$db_username", "$db_password")
or die "\nCouldn't connect: " . $DBI::errstr;

---------------------------------------------------

error message

ct_send(CS_DESCRIBE_INPUT) returned 0 at /usr/local/lib/perl5/site_perl/5.8.0/i386-freebsd/DBD/Sybase.pm line 133, <DATA> line 283.
Segmentation fault (core dumped)


any help will be much appreciated.

Thanks
 
You can use Win32::ODBC

Then create a DSN/Password to connect you to your SQL box -
and use that in your perl script ....

Hope that helps ....

HTH

Rab
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top