Hi
I have this problem.
In Query Analyzer when I write
dbo.spParseArray '12-13-14','-'
everytihng goes OK
but when i write
SELECT * FROM tblOrder WHERE ID_ORDER IN (dbo.spParseArray ('12-13-14','-'))
it returns me an error
Server: message 208, level 16, state 1, row 1
Invalid object name 'dbo.spParseArray'
What's the matter?Hi
Stored Procedures cannot be used as in line functions.
best Regards,
Chandra
http://chanduas.blogspot.com/
http://groups.msn.com/SQLResource/
---
"xxx" wrote:
> Hi
> I have this problem.
> In Query Analyzer when I write
> dbo.spParseArray '12-13-14','-'
> everytihng goes OK
> but when i write
> SELECT * FROM tblOrder WHERE ID_ORDER IN (dbo.spParseArray ('12-13-14','-'
))
> it returns me an error
> Server: message 208, level 16, state 1, row 1
> Invalid object name 'dbo.spParseArray'
> What's the matter?
>
>|||Is dbo.spParseArray a Stored Proc or a UDF? If it's a Stored Proc, you canno
t
use the result set of a Stored Proc in a Select that way, you have to
"insert" the result set into a Table of some kind, (Real tbale, Temp Table,
Table Variable) and then use that table object in your Select.
IOr, rewrite the Stored Proc as a Table-Valued User Defined Function, then
you can write your select as either:
SELECT * FROM tblOrder
WHERE ID_ORDER IN
(Select OrderID
From dbo.spParseArray ('12-13-14','-'))
Or:
SELECT * FROM tblOrder O
Join dbo.spParseArray ('12-13-14','-') A
On A.OrderID = O.ID_Order
"xxx" wrote:
> Hi
> I have this problem.
> In Query Analyzer when I write
> dbo.spParseArray '12-13-14','-'
> everytihng goes OK
> but when i write
> SELECT * FROM tblOrder WHERE ID_ORDER IN (dbo.spParseArray ('12-13-14','-'
))
> it returns me an error
> Server: message 208, level 16, state 1, row 1
> Invalid object name 'dbo.spParseArray'
> What's the matter?
>
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment