XML : sp_executesql xml quit working

I have a stored procedure that takes the contents of a XML file and loads it to tables.

Excerpt:

  declare @XMLdocument xml  declare @doc_handle int    BULK INSERT #XMLfile   FROM @Path   WITH (ROWTERMINATOR = ''' + CHAR(10) + ''')    select @XMLdocument = surveyXML from #XMLfile    exec sp_executesql @doc_handle output, @XMLdocument -- Fails here    

Error: Procedure expects parameter '@statement' of type 'ntext/nchar/nvarchar'.

I realize that sp_executesql expects unicode but the call to sp_executesql has been working for months as defined above. It suddenly stopped working today and I can find nothing about the issue on line.

I'm using SQL Server 2012. Any ideas to solve the problem are much appreciated.

No comments:

Post a Comment