Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
anjali5
Posting Yak Master
121 Posts |
Posted - 2011-11-30 : 15:36:28
|
| I am trying to append a '$$$' sign to a type of ntextso I have this col1, I am trying to soselect '$$$' +[summary]+ '$$$' summaryfrom table AI am getting an error The data types varchar and ntext are incompatible in the add operator.How can I achevie this without getting an error. |
|
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2011-11-30 : 16:13:50
|
| Use UPDATETEXTNote that ntext is deprecated. If you're storing character data, should be using nvarchar anyway. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-12-01 : 00:22:15
|
| if its 2005 or later, since you're not storing concatenated value anywhere and its just in select, easiest method would be to cast ntext to nvarchar(max) and then do the concatenation------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
jassi.singh
Posting Yak Master
122 Posts |
Posted - 2011-12-01 : 04:16:42
|
| Hi,Please refer some casting examples, you will get an idea and clarityhttp://msdn.microsoft.com/en-us/library/ms177561.aspxhttp://www.techrepublic.com/blog/10things/10-reasons-to-explicitly-convert-sql-server-data-types/324http://msdn.microsoft.com/en-us/library/aa276862%28v=sql.80%29.aspx |
 |
|
|
anjali5
Posting Yak Master
121 Posts |
Posted - 2011-12-01 : 12:39:53
|
| I thought there is a limit of 4000 caharacters on varchar and nvarchar. What is the limit on nvarcar(max). I am storing 8000 character data in this field. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-12-01 : 12:44:49
|
quote: Originally posted by anjali5 I thought there is a limit of 4000 caharacters on varchar and nvarchar. What is the limit on nvarcar(max). I am storing 8000 character data in this field.
nvarchar(max) is a BLOB data type and it can store upto 2 GB of data------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
anjali5
Posting Yak Master
121 Posts |
Posted - 2011-12-01 : 13:16:36
|
| Thanks Visakh! |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-12-02 : 01:03:33
|
| wc------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|