473,398 Members | 2,389 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

ntext Question

Dear Group

I admit, this might be a very ignorant question.

BOL says about the ntext data type:
Variable-length Unicode data with a maximum length of 2^30 - 1
(1,073,741,823) characters.

I've stored a string consisting of around 45.000 characters in a ntext
field - done by copying the string in my txt document and pasting in
Enterprise Manager.

When I determine the datalength of the field in SQL Analyzer I get
2046.
Is this realistic? Is it bytes or the actual number of characters? It
seems incrrect to me..

Although, when I read the string with a DataReader based on a stored
procedure and save it in a string variable in my VB.NET application,
the string is truncated, although the variable can hold up to
approximately 2 billion Unicode characters according to MSDN.

I just wonder whether I've done something wrong or misunderstood
something on the SQL server side that causes this problem.

Thanks very much for your help!

Martin
Jul 20 '05 #1
2 3125
Martin (th************@hotmail.com) writes:
BOL says about the ntext data type:
Variable-length Unicode data with a maximum length of 2^30 - 1
(1,073,741,823) characters.

I've stored a string consisting of around 45.000 characters in a ntext
field - done by copying the string in my txt document and pasting in
Enterprise Manager.

When I determine the datalength of the field in SQL Analyzer I get
2046.
Is this realistic? Is it bytes or the actual number of characters? It
seems incrrect to me..


datalength() return the length in bytes, so it appears that only 1023
characters made it to the table through Enterprise Manager. EM is
poor tool for most of the functions it exhibits, and data entry is
one of them. Apparently there is a limitation.

If the document is only 46000 characters, you can write an insert
statement for it in Query Analyzer. However, QA can only handle 64KB
of text. I know, because I tried run an SQL statement with a 500 KB
long XML string the other day... I was able to get that working by
putting it all in a file with a third-party text editor, and run
the file from the command-line tool OSQL.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #2
Hi Erland
Thanks very much for sharing your expertise.
Have a nice day :-)

M
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: tony | last post by:
I changed the datatype of a field in a SQL Server 2000 database from nvarchar to ntext, but now nothing is being displayed. The "Body" column of the datatable used to be nvarchar(8000) and the...
3
by: Matik | last post by:
Hello to all, Below the sample code: declare @arg_szMsgText ntext set @arg_szMsgText = isnull(@arg_szMsgText, N'unknown message') Now the error message I get: "The assignment operator...
1
by: Derek Erb | last post by:
SQL Server 2000 : I have a series of tables which all have the same structure. When any of these tables are modified I need to syncrhonise all of those modifications with one other table wich is a...
2
by: Sileesh | last post by:
HI I know this is not the right forum to post this question, but i think some one might have a suggestion. I have a Table "Test" with columns Id bigint (PK), Number Varchar(50), Notes ntext....
2
by: Igor | last post by:
Is there a way to transfer ntext data from one table to another? I tried this UPDATE SET = (SELECT FROM WHERE =1) WHERE = 1;
3
by: =?Utf-8?B?ZGF2aWQ=?= | last post by:
I try to follow Steve's paper to build a database, and store a small text file into SQL Server database and retrieve it later. Only difference between my table and Steve's table is that I use NTEXT...
2
by: verb13 | last post by:
I am running this query to an sql server 2000 database from my asp code: "select * from MyTable where MySqlServerRemoveStressFunction(MyNtextColumn) = '" & MyAdoRemoveStressFunction(MyString) &...
6
by: Nadina | last post by:
Hi to All! I have one problem... There is a field ntext-type! In this field html-code containing table description is written. For example, <div...
1
by: balamk81 | last post by:
I've a question about ntext and text. How do you use them in a stored procedure? When I try to use an ntext data type in a proc i get this error - 'The assignment operator operation cannot take a...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.