Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Variable Scope
Message
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Title:
Miscellaneous
Thread ID:
00663609
Message ID:
00663669
Views:
22
>Try
SET @sql_string = REPLACE(@sql_string, '@@idoc', CAST(@idoc AS varchar(10)))
>EXEC (@sql_string)
BTW, why it's @@idoc in the @sql_string?
>

That won't really help either... it works like this;
CREATE procedure dbo.getdata_wayne
@doc as ntext

AS

declare @idoc int
	-- Parse XML String	
	EXEC sp_xml_preparedocument @idoc OUTPUT, @doc
	-- Get Data
            SELECT * 
              FROM OPENXML (@idoc, '/ROOT/ID_S',1) WITH 
               (KEYVALUE varchar(16)) AS JT, PREMIUMHEADER
                WHERE PREMIUMHEADER.CPOLICYNUM = JT.KEYVALUE
	-- Remove XML document		
	EXEC sp_xml_removedocument @idoc
GO
Calling it with
exec getdata_wayne '<ROOT><ID_S KEYVALUE="99WCAL138462"/></ROOT>'
But because I'm creating a dynamic where, select list, etc, I don't have the same select.
Wayne Myers, MCSD
Senior Consultant
Forte' Incorporated
"The only things you can take to heaven are those which you give away" Author Unknown
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform