Software I\'m working with uses a text field to store XML. From my searches online, the text datatype is supposed to hold 2^31 - 1 characters. Currently SQL Server is trunca
that is a limitation of SSMS not of the text field, but you should use varchar(max) since text is deprecated
Here is also a quick test
create table TestLen (bla text)
insert TestLen values (replicate(convert(varchar(max),'a'), 100000))
select datalength(bla)
from TestLen
Returns 100000 for me
You should have a look at
So I would rather try to use the data type appropriate for the use. Not make a datatype fit your use from a previous version.
MSSQL 2000 should allow up to 2^31 - 1 characters (non unicode) in a text field, which is over 2 billion. Don't know what's causing this limitation but you might wanna try using varchar(max) or nvarchar(max). These store as many characters but allow also the regular string T-SQL functions (like LEN, SUBSTRING, REPLACE, RTRIM,...).
You can use: Plase user SQL query
.
GO
EXEC sp_configure 'show advanced options', 1 ;
RECONFIGURE ;
GO
EXEC sp_configure 'max text repl size', -1 ;
GO
RECONFIGURE;
Read more in: http://blog.emdiu.com/sql-tips-configure-the-max-text-repl-size-server-configuration-option-commandtext-qua-dai--13
If you're able to convert the column, you might as well, since the text
data type will be removed in a future version of SQL Server. See here.
The recommendation is to use varchar(MAX)
or nvarchar(MAX)
. In your case, you could also use the XML
data type, but that may tie you to certain database engines (if that's a consideration).