perl dbi driver for microsoft sql?

B

Ben Morrow

Quoth Sherm Pendley said:
Quite right.


Actually, no. mSQL is not Microsoft SQL Server, it's a different product:

<http://www.hughes.com.au/products/msql/>

I couldn't find a MS-SQL specific DBD module - I think most people use
DBD::ODBC.

I've had success in the past using DBD::Sybase (it took me a long time
to figure that one out). AFAIK, this is the only way to connect to MSSQL
from a non-MS machine (which I needed to do at the time).

Ben
 
S

Sherm Pendley

Ben Morrow said:
I've had success in the past using DBD::Sybase

I hesitated to mention it, because a quick glance at the docs mentioned only
a few specific versions of MS-SQL, and was in general not very confidence-
inspiring. I'll keep it in mind in the future.
(it took me a long time to figure that one out)

Yeah, it's not very obvious unless you know the history. As I understand it,
MS-SQL is more or less a fork of Sybase, so that the network protocol is more
or less the same.
AFAIK, this is the only way to connect to MSSQL
from a non-MS machine (which I needed to do at the time).

Another approach would be to set up a DBD::proxy server on the Windows box
that's running MS-SQL, and connect to that from just about anything. I've
gotten good results with that approach in the past - although I was writing
for "classic" MacPerl clients connecting to a MySQL server on Solaris.

sherm--
 
S

Sherm Pendley

gavino said:
how id DBD::ODBC set up?

What have you tried? What was the result? Is there some part of the
documentation you're having trouble with?

sherm--
 
J

John Bokma

Jim Gibson said:
By first creating a workable ODBC client environment on your system
and then installing the DBD::ODBC module. Then you can use the
facilities of the DBI module to access your database through the ODBC
layer.

Odd, I never did the client environment thingy. I installed the Desktop
edition (MSDE?) of MS SQL (the free version) and IIRC it worked out of the
box when I installed DBD::ODBC:


use DBI;

my $dbh = DBI->connect(

"dbi:ODBC:driver={SQL Server};"
. "Server=$ENV{ COMPUTERNAME };database=SomeDataBaseName;",
'',
'',
{
RaiseError => 1,
AutoCommit => 1
}
);

has been quite some time, but I can't recall any kind of magic required
:)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top