Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Table as Variable, passing from VFP to an SQL SP.
Message
 
 
To
14/05/2003 13:06:07
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Miscellaneous
Thread ID:
00787977
Message ID:
00788283
Views:
38
This message has been marked as the solution to the initial question of the thread.
>I understand now. I created Mike's SP in a database and then I called it from the Query Analyzer. It dosen't work....
>
>use AcmeTraining
>declare @lcCust1 varchar(600)
>set @lcCust1 = '<customers> <id value="227"/> <id value="228"/> </customers>'
>execute usp_CustomersSelect @lcCust1
>
>
>returns error: Invalid object name 'customers'.

This works for me
CREATE PROCEDURE usp_CustomersSelect
 @customerIDs text
AS
 DECLARE @hDoc int

 EXECUTE sp_xml_preparedocument @hDoc OUTPUT, @customerIDs

 SELECT * 
 FROM 
OPENXML(@hDoc, 'customers/id') WITH (value int) x

 EXECUTE sp_xml_removedocument @hDoc 
GO
declare @lcCust1 varchar(600) 
set @lcCust1 = '<customers> <id value="227"/> <id value="228"/> </customers>'
execute usp_CustomersSelect @lcCust1
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform