Wednesday, March 7, 2012

how to add a nvarchar parameter to ntext or text types?

please help >>

how to add a nvarchar parameter to ntext or text types like :

set @.ntext_param = @.ntext_param + @.nvarchar_param

You cannot declare variables of text/ntext/image data type in SQL Server and manipulate them. You can only have parameters of SPs or functions with these data types. You can however use UPDATETEXT to append a varchar/char/nvarchar/char/text/ntext/varbinary/binary value to text/ntext/image value.

In SQL Server 2005, you can use the new nvarchar(max) and nvarbinary(max) data types similar to regular character data types. This will allow you to use concatenation operators. These data types are replacement for text/ntext/image data types.

|||

Concatenation is not supported on ntext, but is supported on nvarchar(max). You can do the following:

set @.ntext_param = convert(nvarchar(max), @.ntext_param) + @.nvarchar_param

No comments:

Post a Comment