NHibernate Stored procedure with XML parameter

teh ice age

New Member
I think I'm going crazy on this one : it's a fairly simple scenario and should be documented, but... no!Here is my stored procedure declaration:\[code\]CREATE PROCEDURE [dbo].[spImport]( @xmlDocument AS XML)AS---GO\[/code\]Here is my mapping:\[code\]<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="XXX" namespace="XXX.Entities"> <sql-query name="spImport"> <![CDATA[EXEC [dbo].[spImport] @xmlDocument = :xmlDocument]]> </sql-query></hibernate-mapping>\[/code\]And Here is the calling method:\[code\]session.GetNamedQuery("spImport").SetParameter("xmlDocument", document, NHibernateUtil.XmlDoc).ExecuteUpdate();\[/code\]Now, I'm getting the follinging error:\[quote\] While preparing EXEC [dbo].[spImport] @xmlDocument = @p0 an error occurred InnerException: SqlCommand.Prepare method requires all variable length parameters to have an explicitly set non-zero Size.\[/quote\]Thanks for your help,Stefan
 
Back
Top