From: [EMAIL PROTECTED] (PerlDiscuss - Perl Newsgroups and mailing lists) > I am trying to run an MS SQL server stored procedure using Perl. > We are using SQL Server 2000. Using the current Perl and DBI. > Can I use the ODBC DBD? > I am using a prepare,execute and fetch. > Has anyone tried this and do you have examples or how to do this? I > use the 'exec' command but get syntax errors on the execute for the > parameters provided. The prepare doesn't produce any errors. > > my $query = "exec sp_query @criteria = 0";
print "QUERY: $query\n"; > my $sth = $dbh->prepare($query); > $sth->execute(); Does the query look right? Jenda P.S.: I don't think you should use sp_ for your procedures. sp_ is used by the system stored procs and procedures starting with sp_ are looked up not only in the current database, but also in "master"! If you do insist on using the "Hungarian" notation, p_ should be enough. (I don't like and don't use this convention. All my procedures start with a verb (Fetch/Get/Insert/Update/Set/Delete/...) I don't think I need anything more to disambiguate them from tables, views or columns.) ===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz ===== When it comes to wine, women and song, wizards are allowed to get drunk and croon as much as they like. -- Terry Pratchett in Sourcery