You are here: Problem writing XML files. « MsSQL Server « IT news, forums, messages
Problem writing XML files.

Posted by Pi on 09/07/05 00:22

Hi guys,

I have a stored procedure that I will subsequently post below this
message. What the stored procedure does is, it reads some specific
tables in a database and created XML off it.

The problem comes in when the data is bigger than a few hundred/
thousand characters. The data is truncated and the XML file is not
fully made.

Now i have been reading some posts by some people and tried using TEXT/
NTEXT/ IMAGE type to write the files but they give me errors which,
again, I am adding to this email.

STORED PROC:
****************************

CREATE PROCEDURE usrp_sp_makexmlfile
@str varchar(50),
@templatefile varchar(255),
@ReturnValue as image OUT

AS
SET NOCOUNT ON
DECLARE @strVar as varchar(8000)
/*DECLARE @ReturnValue as varchar(255)*/

Set @strVar = 'Select * from ' + @str + ' FOR XML AUTO'
Set @templatefile = 'c:\template.tpl'

EXEC (@strVar)

SELECT @ReturnValue
GO





THIS IS WHAT I GET WHEN I USE IMAGE/NTEXT/TEXT TYPE:
*********************************************************

An unhandled exception of type 'System.InvalidOperationException'
occurred in system.data.dll

Additional information: Parameter 2: '@ReturnValue' of type: Byte[],
the property Size has an invalid size: 0


Also, if i try to add an integer value to the image/text/ntext like
8000 or something less than that, it tells me that the result has to be
discarded because the current process has had some error.


Can someone give me a suggestion on how to resolve this or an example
that would illustrate the solution? Thank you all in advance.

Pi.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация