简体   繁体   中英

Use query result as parameter to stored procedure in SSMS

I have a stored procedure that takes a single parameter of data-type XML.

I also have a table that has XML samples which I'd like to test as the parameter for this procedure.

Is it possible to exec the SP and pass the result of a query on the test table as the XML input parameter? What would the syntax be?

Something like this:

declare @myvar xml

select top 1 @myvar=your_xml_column from your_table where your_condition

exec spYourProc @xmlparam=@myvar

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM