Note easy: SP return resultsets (or recordsets), not tables or views and you
cannot select from a resultset directly. To do so, you must use OPENQUERY,
OPENROWSET, or OPENDATASOURCE to call the SP from another SP. These
procedures requires that you use a connection string to the server itself or
that you create a linked server, also pointing toward itself. See the BOL
for more info on these three functions.
The easiest and best solution for you is probably to convert your SP to a
View or a User Defined Function (UDF), which may be called directly from a
Select. Also, with UDF, you must often provide the full name including the
schema; ie. use dbo.MyUDF() instead of just MyUDF().
On the ADP side, to call a UDF as the record source of a form, you must use
a full SQL statement and not just the name (as you would do for a SP):
Select * from MyUDF()
--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail:
http://cerbermail.com/?QugbLEWINF
Dimitris Nikolakakis said:
I have a stored procedure named [ORD-qClientsOrders] and I want to create
another SP that SELECTS records from
[ORD-qClientsOrders].
The error is 'Invalid object name ORD-qClientsOrders.'
Thanks
Dimitris