Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cast string+ntext to nvarchar error

Tags:

sql

sql-server

I am trying to cast a string and a column value concatenated with the following sql commant:

 CAST('Strign:'+[KlirAn] as NVARCHAR(max))

After executing this command i get the following error:

    Msg 402, Level 16, State 1, Line 1
The data types varchar and ntext are incompatible in the add operator.

Any help please?

like image 277
user1292656 Avatar asked Jul 08 '13 09:07

user1292656


1 Answers

Try the following:

'String:'+ CAST([KlirAn] as NVARCHAR(max))
like image 119
Paddy Avatar answered Oct 17 '22 07:10

Paddy