Link to home
Start Free TrialLog in
Avatar of mtiDev
mtiDev

asked on

How do I send xml special characters (like &) to stored procedure

How do I send xml special characters (like &) to stored procedure....See the & below in T & A
Command: EXEC [dbo].[usp_wpCreateShipmentDocuments] @documents = <ShipmentDocuments><Item><SkShipmentNumber>15698</SkShipmentNumber><FormCwtCodeSKey>97</FormCwtCodeSKey><OriginPlantNumber>7019</OriginPlantNumber><GeneratorCustomerNumber>215555</GeneratorCustomerNumber><GeneratorPhone>708-499-1869</GeneratorPhone><GeneratorRegion>IL</GeneratorRegion><GeneratorMailName>T & A MOBIL SVC LTD</GeneratorMailName><GeneratorMailAddress1>10240 S PULASKI

Open in new window

Avatar of pivar
pivar
Flag of Sweden image

Hi,

Try this

/peter
EXEC [dbo].[usp_wpCreateShipmentDocuments] @documents = '<ShipmentDocuments><Item><SkShipmentNumber>15698</SkShipmentNumber><FormCwtCodeSKey>97</FormCwtCodeSKey><OriginPlantNumber>7019</OriginPlantNumber><GeneratorCustomerNumber>215555</GeneratorCustomerNumber><GeneratorPhone>708-499-1869</GeneratorPhone><GeneratorRegion>IL</GeneratorRegion><GeneratorMailName>T &amp; A MOBIL SVC LTD</GeneratorMailName><GeneratorMailAddress1>10240 S PULASKI'

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Mark Wills
Mark Wills
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If you have them in an XML datatype, it will already have &amp in it.  Also, if you cast a string that has the value &, it will change it.