SQL Server Performance Forum – Threads Archive
How to play with ntext field in Stored procedureHello, Is it possible to define a variable of type ntext in stored procedure? I have a table which contains one column (ntext) for mail body. When I sent that mail body to any person from stored procedure, I need to apply some updates in that mail body. Right now I am doing it by converting ntext value into varchar (8000). But I have some mail bodies which contains more than 8000 characters. Would you be so kind to guide me on "How can I send mail body of more than 8000 characters after applying necessary updates?" Thanks, Haresh
Hi, In sql server 2005, microsoft has addressed this long standing demand by introducing Large Value Datatype like Varchar(Max),nvarchar(max) etc. In sql 2000, to store more than 8000 bytes of text or binary data in a column, the only option was to use text or image data types. But these two data types have lot of limitation for example, many string functions do not work on text/image columns, you cannot define a variable of type text/image, and so on. To fix this, SQL Server 2005 introduces these max specifier. The max specifier can be used with varchar, nvarchar, and varbinary types, and it allows you to store up to 2GB of data into a column, variable, or parameter, without any different handling requirements. Read more about this before implement.
Refer these links :- http://msdn2.microsoft.com/en-us/library/ms178158.aspx