Showing posts with label ntext. Show all posts
Showing posts with label ntext. Show all posts

Friday, March 9, 2012

Problem When I save Data In Database

Hi

I have problem in the data when I save it in database !!!

From Windows Application I Send (nText) Data to SQL Server Database in Web Server but when I try to explore it in SQL Server Enterprise manager or ny SQL Server DB Manager I see the Fields of (nText) Data is empty but when I try to brows the data in ASP.NET page I get it like the following

? ? ? ??? ??? ?? ? ? ???, ??? ?? ?? ?? ???. ??
??". ?? ??? ?? ?? ??? ???, ?? ??? ??? ??.
?? ??, ??? ? ? ??? ???, ? ?? ?? ?? ?? ??? ??

So I thing the data has been damaged!!
Why this problem... And how can I solve it??

The Problem only in (nText) Data ..

And thanks with my best regarding??It seems you need to take two steps. The first is to change the collation of SQL to ARABIC_CI_AI. Second, you need to change your web.config to set endocing to unicode.

hope help.

Bassam Basamad|||Hi

Thanks for your reply

First of all .. you talk about (web.config) File .. But my problem in SQL Server Database .. there is no problem in ASP.NET Pages (I know how to make it support Unicode chars) but the problem in Database

And the seconded thing about the (ARABIC_CI_AI.) I have do it from the first time when I create my Tables in SQL Server

So sorry .. your solution . don't solve my problem

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 @.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"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/techin.../2000/books.asp

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

problem using ntext

Hi, I'm using a column(ntext) to store some long strings. An example of the string that I need to store is the following:

436;Implementing A Gang - Awareness Program/And A Middle SchoolGang Prevention Curriculum. Doctoral Th;Samuels;Donald J;MiamiIV;Administrators; At Risk; Child And Youth Studies; Community;Community Members; Drop Out Prevention; Educational Leadership;Law/Criminal Justice; Peer Counseling; Principals; Secondary Education

I wrote a store procedure that does it, but it seems that the columnspace is not enough for the above string. The string in fact, istruncated and only the following portion is stored in my table:

436;Implementing A Gang - Awareness Program/And A Middle School Gang Prevention Curriculum. Doctoral Th;Samuels;Donald J;MiamiIV;Administrators; At Risk; Child And Youth Studies; Community;Community Members; Drop Out Prevention; Educational Leadership

What can I do?

ChristianIf you are not storing more than 4000 characters you can use NVarChar 4000 is the limit. The reason there are issues with NText and limitations. Hope this helps.|||I have just changed the column type from text to varchar(4000).
But I still have the same problem.

Christian|||

Try the link below for working code sample. Hope this helps.

http://msdn2.microsoft.com/en-us/library/system.data.sqlclient.sqldataadapter.insertcommand.aspx

|||

christianmala:

I wrote a store procedure that does it, but it seems that the columnspace is not enough for the above string. The string in fact, istruncated and only the following portion is stored in my table:


How are you checking what is stsored in your table? I highly suspect you are using Query Analyzer, which by default will only display the first 256 characters in a column. To change this value in QA, Tools - Options - Results - Maximum characters per column. Change 256 to something larger.|||Oh God,
you are so right!!!!!

Thanks,

Christian