Code Comments
Programming Forum and web based access to our favorite programming groups.Any idea of why the cast in this statment would give an error? See a printou
t
of the statement below. The error text "Syntax error near cast". Or in the
case of running the printed statement the error is "Syntax error near 5".
*****Dynamic sql ***********
set @sqlXml = ' SELECT @newValue = xmlEEBank.' + @sqlFieldName + ' ,
@empnum = xmlEEBank.empnum FROM OPENXML(' + cast(@hDoc as nvarchar(10)) + ',
''/ROOT/EEbank'') with EEBank xmlEEBank'
EXECUTE sp_executesql @sqlXml, @params, @newValue = '', @empnum = '', @hDoc
= @hDoc
*************Printed statement*************
SELECT @newValue = xmlEEBank.Bank1Name , @empnum = xmlEEBank.empnum FROM
OPENXML(5, '/ROOT/EEbank') with EEBank xmlEEBank
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.