Reputation: 10981
I am trying to update a field with the contents of itself an added string but it does not work
UPDATE Products_Joined SET Products_Joined.TechSpecs = Products_Joined.TechSpecs + 'test'
Any ideas
Upvotes: 3
Views: 12037
Reputation: 61
If you want to join two string in SQL use CONCAT as CONCAT (string1,string2)
an example:
UPDATE Products_Joined
SET TechSpecs = CONCAT (TechSpecs ,'test') ;
Upvotes: 1
Reputation: 138960
Data type is text
If you are on SQL Server 2005 or higher you can cast your text
column to varchar(max)
.
UPDATE Products_Joined
SET TechSpecs = ISNULL(CAST(TechSpecs AS VARCHAR(MAX)), '') + 'test'
Upvotes: 2
Reputation: 12271
Since the column data type is text you cannot do a concatenation with a string since the column TexhSpecs is binary data type(TEXT) .
Upvotes: 0
Reputation: 66
that should work, but you might need to remove the table name
UPDATE Products_Joined SET TechSpecs = TechSpecs + 'test'
Upvotes: 2