dbTalk Databases Forums  

Error Code 0xc00ce562

microsoft.public.sqlserver.xml microsoft.public.sqlserver.xml


Discuss Error Code 0xc00ce562 in the microsoft.public.sqlserver.xml forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Alberto
 
Posts: n/a

Default Error Code 0xc00ce562 - 02-19-2010 , 07:46 AM






In a Asp.Net 3.5 application I need to read this XML chunk, inside a Stored
Procedure (sql Server 2008):



declare @xml varchar
set @Xml =
'<Root><Foto><txtNomeFoto>150-1.jpg</txtNomeFoto><txtDescrizione>150-1</txtDescrizione><IdCategoria>1</IdCategoria><IdSc>1</IdSc><IdScSc>1</IdScSc><urlFotoPiccola>-FotoMie-Piccole-</urlFotoPiccola><urlFotoGrande>-FotoMie-Grandi-</urlFotoGrande><txtNomeFotoPiccola>150-1.jpg</txtNomeFotoPiccola></Foto></Root>'

declare @xml1 int

EXEC sp_xml_preparedocument @xml1 OUTPUT, @xml

select txtNomeFoto, txtDescrizione, IdCategoria, idSc, IdScSc,
urlFotoPiccola,
urlFotoGrande, txtNomeFotoPiccola
FROM OPENXML (@xml1, 'Root/Foto',2)
WITH (txtNomeFoto varchar, txtDescrizione varchar, IdCategoria bigint, IdSc
bigint, IdScSc bigint, urlFotoPiccola varChar, urlFotoGrande varchar,
txtNomeFotoPiccola varchar)

The procedure is a little more complex and the xml is passed as parameter,
but in this code I have the following error code: 0xc00ce562 tag "<" not
closed.
Where is my mistake?


Tks in advance for any help

Alberto - Italy

Reply With Quote
  #2  
Old   
Bob
 
Posts: n/a

Default RE: Error Code 0xc00ce562 - 02-22-2010 , 03:57 AM






As you haven't declared a length for your varchar it is defaulting to a
length of 1.

Try this:
declare @xml varchar(max)

Note this applies to you OPENXML statement too, eg:

WITH (txtNomeFoto varchar(50), txtDescrizione varchar(50), IdCategoria
bigint, IdSc
bigint, IdScSc bigint, urlFotoPiccola varchar(50), urlFotoGrande varchar(50),
txtNomeFotoPiccola varchar(50) )


Also, as you're using SQL 2008 you should probably be using the XML
data-type and it's methods instead of OPENXML

"Alberto" wrote:

Quote:
In a Asp.Net 3.5 application I need to read this XML chunk, inside a Stored
Procedure (sql Server 2008):



declare @xml varchar
set @Xml =
'<Root><Foto><txtNomeFoto>150-1.jpg</txtNomeFoto><txtDescrizione>150-1</txtDescrizione><IdCategoria>1</IdCategoria><IdSc>1</IdSc><IdScSc>1</IdScSc><urlFotoPiccola>-FotoMie-Piccole-</urlFotoPiccola><urlFotoGrande>-FotoMie-Grandi-</urlFotoGrande><txtNomeFotoPiccola>150-1.jpg</txtNomeFotoPiccola></Foto></Root>'

declare @xml1 int

EXEC sp_xml_preparedocument @xml1 OUTPUT, @xml

select txtNomeFoto, txtDescrizione, IdCategoria, idSc, IdScSc,
urlFotoPiccola,
urlFotoGrande, txtNomeFotoPiccola
FROM OPENXML (@xml1, 'Root/Foto',2)
WITH (txtNomeFoto varchar, txtDescrizione varchar, IdCategoria bigint, IdSc
bigint, IdScSc bigint, urlFotoPiccola varChar, urlFotoGrande varchar,
txtNomeFotoPiccola varchar)

The procedure is a little more complex and the xml is passed as parameter,
but in this code I have the following error code: 0xc00ce562 tag "<" not
closed.
Where is my mistake?


Tks in advance for any help

Alberto - Italy

.

Reply With Quote
  #3  
Old   
Alberto Vitiello
 
Posts: n/a

Default Re: Error Code 0xc00ce562 - 02-25-2010 , 07:47 AM



You are right!!!!
Tks for the answer

Alberto

"Bob" <Bob (AT) discussions (DOT) microsoft.com> ha scritto nel messaggio
news:A5CD185C-FEBC-4740-A7BD-443812E96187 (AT) microsoft (DOT) com...
Quote:
As you haven't declared a length for your varchar it is defaulting to a
length of 1.

Try this:
declare @xml varchar(max)

Note this applies to you OPENXML statement too, eg:

WITH (txtNomeFoto varchar(50), txtDescrizione varchar(50), IdCategoria
bigint, IdSc
bigint, IdScSc bigint, urlFotoPiccola varchar(50), urlFotoGrande
varchar(50),
txtNomeFotoPiccola varchar(50) )


Also, as you're using SQL 2008 you should probably be using the XML
data-type and it's methods instead of OPENXML

"Alberto" wrote:

In a Asp.Net 3.5 application I need to read this XML chunk, inside a
Stored
Procedure (sql Server 2008):



declare @xml varchar
set @Xml =
'<Root><Foto><txtNomeFoto>150-1.jpg</txtNomeFoto><txtDescrizione>150-1</txtDescrizione><IdCategoria>1</IdCategoria><IdSc>1</IdSc><IdScSc>1</IdScSc><urlFotoPiccola>-FotoMie-Piccole-</urlFotoPiccola><urlFotoGrande>-FotoMie-Grandi-</urlFotoGrande><txtNomeFotoPiccola>150-1.jpg</txtNomeFotoPiccola></Foto></Root>'

declare @xml1 int

EXEC sp_xml_preparedocument @xml1 OUTPUT, @xml

select txtNomeFoto, txtDescrizione, IdCategoria, idSc, IdScSc,
urlFotoPiccola,
urlFotoGrande, txtNomeFotoPiccola
FROM OPENXML (@xml1, 'Root/Foto',2)
WITH (txtNomeFoto varchar, txtDescrizione varchar, IdCategoria bigint,
IdSc
bigint, IdScSc bigint, urlFotoPiccola varChar, urlFotoGrande varchar,
txtNomeFotoPiccola varchar)

The procedure is a little more complex and the xml is passed as
parameter,
but in this code I have the following error code: 0xc00ce562 tag "<" not
closed.
Where is my mistake?


Tks in advance for any help

Alberto - Italy

.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.