The reason you get this error is because of the statement "use Northwind" the solution:
in reply to Getting MSSQL message return on DBI
1) execute that statement in a separate statement handle
-- OR BETTER --
2) use fully qualified statements ( which is the most correct and you should ALWAYS do ;-) Fully qualified means to do something like
Most applications like SQL Query Analyzer parse the use statement out for you and that is why you might think it is ok to use.
select A.[Column Name]
from [Database Name].[owner].[Table Name] A