MS SQL errors in my script



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

Relevant Pages

  • Re: Same Internal Server Error from last two days
    ... I am trying to run a Hello World Perl Script in Apache 2.2. ... But its constantly giving me Internal Server Error.The script ... # have to place corresponding `LoadModule' lines at this location so the ...
    (perl.beginners)
  • RE: Fulltext failure on a 2 node cluster
    ... Server full-text search resource online: "SQL Cluster Resource 'Full Text' ...
    (microsoft.public.sqlserver.clustering)
  • Re: HELP PLEASE ~ ???
    ... You mentioned that it went ahead and added a SQL ... SQL Server 2000 database for all my data. ... find the connectionString in the newly recreated SQLExpress database. ... The connection string specifies a local Sql Server Express instance ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Same Internal Server Error from last two days
    ... I am trying to run a Hello World Perl Script in Apache 2.2. ... But its constantly giving me Internal Server Error.The script Runs perfectly fine from the command prompt. ... # This is the main Apache HTTP server configuration file. ... LoadModule actions_module modules/mod_actions.so ...
    (perl.beginners)
  • Same Internal Server Error from last two days
    ... I am trying to run a Hello World Perl Script in Apache 2.2. ... But its constantly giving me Internal Server Error.The script ... # have to place corresponding `LoadModule' lines at this location so the ...
    (perl.beginners)