Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Table as Variable, passing from VFP to an SQL SP.
Message
 
 
À
14/05/2003 13:06:07
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Divers
Thread ID:
00787977
Message ID:
00788283
Vues:
36
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--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform