p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

xml_databases thread: RE: Variable size in SP


Message #1 by "Carmen Sanz" <c.sanz@g...> on Thu, 4 Apr 2002 16:32:33
When using the text variable you should not specify a limit. 
Use:

CREATE PROC SP_INSERT
	@text	text,
	@week_no	int
AS

Try this one.

-----Original Message-----
From: Carmen Sanz [mailto:c.sanz@g...]
Sent: Thursday, April 04, 2002 7:33 PM
To: XML_Databases
Subject: [xml_databases] RE: Variable size in SP


hi!

Thanks for your answer!
I still have one question about it ...

When I try to write in my stored procedure (which I execute in VBScript)

CREATE PROC SP_INSERT
	@text	text(10000),
	@week_no	int
AS

instead of 

CREATE PROC SP_INSERT
	@xml_data 	varchar(8000),
	@week_no	int
AS

I get the following error :

"the size (10000) given to the type 'text' exceeds the maximum allowed for 
any data type (8000)"

and now?

Thank you!

Carmen


> You can call this procedure using a VB script and use a sql server Text
> Variable type instead of the varchar type. 
> 
> 
> -----Original Message-----
> From: Carmen Sanz [mailto:c.sanz@g...]
> Sent: Thursday, March 28, 2002 1:29 PM
> To: XML_Databases
> Subject: [xml_databases] Variable size in SP
> 
> 
> HI!
> 
> in my stored procedured I get as input an xml file and 
> insert the read data in the corresponding table. 
> I use a variable for it which is varchar(8000). 
> When I run the SP I get the following error:
> "XML parsing error: A name contained an invalid character"
> I guess, it is due to the fact, that my xml file is bigger 
> than the size of the variable, although I am not sure of 
> that, because i do not know, how big is the file exactly.
> 
> I am not allowed to change the size of this variable in 
> the SP ... I have already tried it ...
> 
> Is there any way to solve this?
> 
> The SP starts as follows:
> 
> CREATE PROC SP_INSERT_If_EXISTS
> 	@xml_data 	varchar(8000),
>                    ...
> 	
>         DECLARE @hDoc		int
>                    
> 	EXEC sp_xml_preparedocument @hDoc OUTPUT, @xml_data
>                    ...
> 
> (do you need for information to understand what I mean?
> 
> Thanks in advance,
> Carmen
> 
> 

  Return to Index