humm... looks like I've seen this post in another category.. anyways to make your code clean, I suggest that create a stored procedure that will execute the sp_xml_preparedocument, and this stored procedure call it in the .NET passing a NTEXT Datatype to its parameter.CREATE PROCEDURE [dbo].[SampleProc] @xmlData AS ntextASBEGIN DECLARE @hDoc int EXEC sp_xml_preparedocument @hDoc OUTPUT, @xmlData INSERT INTO YourTable ( WSCode, CustType ) SELECT * FROM OPENXML(@hDoc, '/Map', 2) WITH ( WSCode nvarchar(100) 'WSCode', CustType char(2) 'CustType' ) EXEC sp_xml_removedocument @hDocENDGO
"If the automobile had followed the same development cycle as the computer, a Rolls-Royce would today cost $100, get a million miles per gallon, and explode once a year, killing everyone inside. "
raclede