Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 STORED PROC => OPENQUERY => Cannot Process Object

Author  Topic 

MGouders
Starting Member

30 Posts

Posted - 2009-09-18 : 16:43:42
Greetings,

Creating a stored procedure which executs a SELECT statement against DB2 using ad-hoc OPENQUERY statement returns the following error:

Msg 7357, Level 16, State 2, Procedure usp_bbbb_aaaa_xxxx, Line 21
Cannot process the object "SELECT DISTINCT

Looking for insight to understand the concept of how stored procedures are getting saved and causing this kind of error

Thanks

YellowBug
Aged Yak Warrior

616 Posts

Posted - 2009-09-19 : 17:21:53
Are you able to run the SELECT statement successfully (outside of the stored procedure)?
SELECT * FROM OPENQUERY(DB2Svr, 'SELECT DISTINCT column1 FROM Table1');

Can you run other SELECT statements on this linked server?
Does the SQL Server service account have access to the DB2 database?
Go to Top of Page
   

- Advertisement -