On Tue, 2003-04-01 at 06:20, Adam Peterson wrote: > here's a sample piece that works when i don't include "use eggsupp;"
> my $sql = " > use eggsupp; > select * > from filesupp > where owner like 'Adam%' > "; > > $sth = $dbh->prepare($sql); The "use <database>" command has to be executed in a batch by itself. If you connect to the server with an interactive tool (for Sybase I'd use isql, don't know about MS-SQL) you have the same issue, and you can't send the "use <database>" request as part of a larger SQL batch. The alternative is to split your request into two requests as another poster suggested, or to rewrite your query to use fully qualified table name(s): select ... from eggsupp..filesupp where ... Michael -- Michael Peppler Data Migrations, Inc. [EMAIL PROTECTED] http://www.mbay.net/~mpeppler Sybase T-SQL/OpenClient/OpenServer/C/Perl developer available for short or long term contract positions - http://www.mbay.net/~mpeppler/resume.html