MS SQL errors in my script
- From: jordanmueller@xxxxxxxxx (Jordan Mueller)
- Date: Mon, 21 May 2007 14:00:02 -0400
Hello,
I am trying to write a script that connects to a remote MS SQL database.
I have set up dsn on my server before and have no problem connecting. But
something is working this time.
I am pasting my script and the error messages below. If nay one has any
experience with MS SQL Errors that would be very helpful.
++++++++++++++++++++++++++++++++++++++++++++++++++
DBI Script
++++++++++++++++++++++++++++++++++++++++++++++++
my $data_source = 'EXAMPLE';
my $dbh = DBI->connect("dbi:ODBC:$data_source", 'test',
'password') || die "unable to connect: $DBI::errstr";
my $statement = 'SELECT * FROM Patients';
my $sth = $dbh->prepare($statement) ||
die "unable to prepare $statement: $DBI::errstr";
$sth->execute() || die "$DBI::errstr";
my $data = $sth->fetchrow_arrayref();
$dbh->disconnect();
++++++++++++++++++++++++++++++++++++++++++++
ERRORS
+++++++++++++++++++++++++++++++++++++++++++++
[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name
'Patients'. (SQL-42S02)
[Microsoft][ODBC SQL Server Driver][SQL Server]Statement(s) could not be
prepared. (SQL-42000)(DBD: st_execute/SQLExecute err=-1) at rcmp.pl line 32.
+++++++++++++++++++++++++++++++++++++++++++++
The connection seems to be fine, I don't know what to do about SQL Server
errors.
Thank you,
Jordan
- Follow-Ups:
- Re: MS SQL errors in my script
- From: Jenda Krynicky
- Re: MS SQL errors in my script
- Prev by Date: Any possiblity to run the perl scripts for both oracle 8i and 9i environments from the same server.
- Next by Date: Re: MS SQL errors in my script
- Previous by thread: Any possiblity to run the perl scripts for both oracle 8i and 9i environments from the same server.
- Next by thread: Re: MS SQL errors in my script
- Index(es):
Relevant Pages
|