Questions tagged [ntext]

ntext is a data type in SQL Server. Questions should be specifically about the ntext data type, such as it's behaviour or (lack of) functionality, such as when compared to nvarchar(MAX) that superceded it in SQL Server 2005.

ntext allows for storage of values longer than 4,000 characters/8,000 bytes in a string based data type in SQL Server.

The data type was deprecated in SQL Server 2005 and should not be used in new development work, and ideally work to replace any existing use of it should be completed. Microsoft have stated the data type will be removed in a future version of SQL Server, however, as of SQL Server 2022 the data type has not yet been removed.

ntext (as well as text and image) cannot be used in a lot of functionality that the newer data types can be used in.

56 questions
1
vote
1 answer

Like operator and Trailing spaces in SQL Server

This one matches column_name like 'CharEndsHere%' and This one doesn't column_name like 'CharEndsHere' I know that like operator will consider even the trailing spaces, so I just copied the exact column value (with trailing spaces) and pasted it.…
Vignesh Paramasivam
  • 2,360
  • 5
  • 26
  • 57
1
vote
4 answers

SQL: Alternative to text and ntext data type?

I'm currently designing a MS SQL table for use in a project. The problem I'm currently facing is that the data types of "Transact SQL " are pointing to the deprecation of the types "text" and "ntext", which I always used for big texts. Char, nchar,…
indect
  • 41
  • 1
  • 5
1
vote
2 answers

Modifying value of ntext column

I have a column in ntext which holds large unicode strings longer than 4000 chars in length. I need to update/modify the data of the rows of the column in sql but I have no clue how to do so. I have tried nvarchar(max) as a buffer but it truncates…
user247759
  • 13
  • 3
0
votes
2 answers

SSIS Destination new table ntext

Why when running an SSIS job and telling the destination editor to create a new table would it default certain text fields to NTEXT data type in the new table even though the source table for the field(s) in question is varchar?
JsonStatham
  • 9,770
  • 27
  • 100
  • 181
0
votes
2 answers

How can I display an ntext field as a long string in a view?

We have one of our systems that is using SQL Views to make reports. This are exported into CSV. There is a table I'm working on that one of the fields is ntext, in this field we store some HTML code. It's an email log we send from the online system.…
Federico Giust
  • 1,803
  • 4
  • 20
  • 45
0
votes
1 answer

Unable to Search for Specific Russian Text in SQL Server ntext Column Using LIKE Operator

I'm currently working on an ASP.NET Core application that uses Entity Framework Core to interact with a SQL Server database. I have a specific issue where I'm unable to search for Cyrillic text in a column of type ntext. Here's the method I'm using…
Torekhan
  • 3
  • 3
0
votes
1 answer

Update ntext column

I'm having an article table which has a ntext column called SearchText which contains the whole article stripped for html. When iterating through our +60000 articles I forgot to add a column to the SearchText content. I'm now trying to update the…
0
votes
1 answer

Excel Destination [140]: An error occurred while setting up a binding for the column. The binding status was "DT_NTEXT"

I have SSIS package that takes data from OLE DB source and loads to an Excel. The Field in the SQL table is nvarchar(max) and the data conversion I put for it when it goes into the excel is DT NTEXT. But I still keep getting this error. I would…
Mahee
  • 63
  • 6
0
votes
2 answers

SQL Server reducing the length of the string to 8000 characters

I am trying to insert data in a table with column datatype as NTEXT. Ideally it should store more than 8000 characters, but the in my case it is reducing it to 8000 characters. I am making the Insert Query at runtime in Procedure. Below is the…
vnkotak
  • 129
  • 4
  • 14
0
votes
1 answer

Why Data Type DT_NTEXT from SQL Command OLE DB Source?

In our SSIS package, in the Data Flow OLE DB Source Editor, the Connection Manager is a SQL Command, and the SQL Command text is this: With Managers AS ( select distinct t1.ID, STUFF((SELECT distinct ' & ' + t2. MgrName from myTableA t2 …
faujong
  • 949
  • 4
  • 24
  • 40
0
votes
0 answers

SQL Server 2014 Backup Performance and NTEXT columns

I run a database that has a tables with several NTEXT columns that contain short lived data. We would normally only keep a few weeks of data in those tables but in an effort to reduce disk usage this was reduced down to only 72 hours. While I…
noble6
  • 51
  • 2
0
votes
1 answer

T-SQL appending data to NTEXT column

Can anyone help me figure out why I am getting the error below from the SQL script? Any and all help is greatly appreciated. DECLARE @Comment AS VARCHAR(2000) DECLARE @Len AS INT SET @Comment = 'This is a test and only a test!' SET @Len =…
Brono The Vibrator
  • 1,135
  • 3
  • 11
  • 19
0
votes
2 answers

Parameter query on nvarchar(max) shows as ntext error

I recently converted all ntext column types in my database to nvarchar(max). I then ran EXECUTE sp_refreshview for the related views. Yet when I run the following Parameter query (from classic ASP) on a view, I get an error: Query: SELECT …
gina
  • 23
  • 4
0
votes
0 answers

After changing a column from ntext to varchar(max) a query becomes slightly slower

After changing a column from ntext to varchar(max) a query becomes slightly slower. I'm doing a select * from table_with_ntext vs select * from table_with_nvarchar_max I thought that since the lob logical reads decrease so much (213860 vs 6) vs…
roncansan
  • 2,310
  • 6
  • 27
  • 34
0
votes
1 answer

SQL converting NTEXT -> VARCHAR -> FLOAT and doing a difference

I have two fields, one that is int and one that is ntext. I need to subtract the ntext field from the int field. Im taking Hours_Current which is the int field and dividing it by 60. I've debugged this for a while and can confirm that the first CAST…