Saturday, February 25, 2012

problem using ntext data type in OPENXML

Hi,
I've got problems using ntext data in a stored procedure (SQL-Server
2000):
create procedure testproc
@.xmldata ntext
as
declare @.Paramntext
exec sp_xml_preparedocument @.idoc OUTPUT, @.xmldata
select @.Param=Param
from openxml(@.idoc, '//ROOT/Parameters')
with (
Paramntext
)
But if I pass "Param" I'll receive an internal error. If "Param" and
"@.Param" are declared as "varchar(2000)" everything works fine.
Any hints?
xpost & f'up
"Tom" <me@.privacy.net> wrote in message
news:6vqit05cnuomoouvpi9279b7bl4smbbmne@.4ax.com...
> Hi,
> I've got problems using ntext data in a stored procedure (SQL-Server
> 2000):
> create procedure testproc
> @.xmldata ntext
> as
> declare @.Param ntext
> exec sp_xml_preparedocument @.idoc OUTPUT, @.xmldata
> select @.Param=Param
> from openxml(@.idoc, '//ROOT/Parameters')
> with (
> Param ntext
> )
>
> But if I pass "Param" I'll receive an internal error. If "Param" and
> "@.Param" are declared as "varchar(2000)" everything works fine.
> Any hints?
> xpost & f'up
From a pure TSQL point of view, the obvious problem is that you cannot
declare ntext variables - see DECLARE in Books Online. I'm not sure how you
would best address this in the context of your problem, so hopefully someone
from the XML newsgroup will be able to suggest something.
Simon
|||Can you use a temp table or an output parameter instead?
HTH
Michael
"Simon Hayes" <sql@.hayes.ch> wrote in message
news:41d99274$1_3@.news.bluewin.ch...
> "Tom" <me@.privacy.net> wrote in message
> news:6vqit05cnuomoouvpi9279b7bl4smbbmne@.4ax.com...
> From a pure TSQL point of view, the obvious problem is that you cannot
> declare ntext variables - see DECLARE in Books Online. I'm not sure how
> you would best address this in the context of your problem, so hopefully
> someone from the XML newsgroup will be able to suggest something.
> Simon
>
|||Tom (me@.privacy.net) writes:
> I've got problems using ntext data in a stored procedure (SQL-Server
> 2000):
> create procedure testproc
> @.xmldata ntext
> as
> declare @.Param ntext
> exec sp_xml_preparedocument @.idoc OUTPUT, @.xmldata
> select @.Param=Param
> from openxml(@.idoc, '//ROOT/Parameters')
> with (
> Param ntext
> )
>
> But if I pass "Param" I'll receive an internal error. If "Param" and
> "@.Param" are declared as "varchar(2000)" everything works fine.
If you get "Internal error", that's a bug. However, you cannot assign to
ntext parameters anyway, so you are unfortunately out of luck.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp

No comments:

Post a Comment