Hi. I have a stored procedure. It is written before two years. Now i need to run this. But i have a problem. Below, i show how i run stored procedure and values. These values comes from program.
GO
DECLARE @return_value int
EXEC @return_value = [dbo].[PRC_KLS_Rapor_DavranisNotlariListesi]
@SiniflarXML = N'<?xml version=\"1.0\" encoding=\"utf-16\"?><IDLIST><ID VALUE=\"d4c810ba-36ea-4872-84d0-8c4cfe956e3c\" /><ID VALUE=\"62d6159f-809f-4b5e-9071-8058f47e57fc\" /></IDLIST>',
@DonemID = 1,
@DersYiliID = 'f7a801a6-f66f-4ae6-838a-33bdfb0fd52b'
SELECT 'Return Value' = @return_value
GO
In stored procedure xml file processed as below:
DECLARE @hDoc int
EXEC sp_xml_preparedocument @hDoc OUTPUT, @SiniflarXML;
SELECT VALUE INTO #tmpSiniflar FROM OpenXML(@hDoc, '/IDLIST/ID', 1) WITH (VALUE uniqueidentifier)
EXEC sp_xml_removedocument @hDoc
SELECT * FROM Siniflar
...
..
where S.DersYiliID = @DersYiliID
AND S.SinifID IN (SELECT VALUE FROM #tmpSiniflar)
AND ODN.DonemID = @DonemID
When i run SP, it gives below error.
Msg 9413, Level 16, State 1, Procedure PRC_KLS_Rapor_DavranisNotlariListesi, Line 0
XML parsing: line 1, character 15, A string literal was expected
I don't know weel xml on sql server. Can oneon help me about this? Thanks in advance.