Link to home
Start Free TrialLog in
Avatar of stressfreewebs
stressfreewebs

asked on

Migration to MSSQL - Concatenation in Update Statement

I am migrating a database from access to MSSQL, and updating the website coding as I go. I had an update statement as follows:

UPDATE Customers SET cCredit = cCredit+"&Request.form("credit")&", cCreditNotes = '"&DATE()&"-"&Request.form("credit")&"-"&why&";"&cCreditNotes WHERE cId = "& Request.form("cust") &"

Open in new window


The update of cCreditNotes is supposed to add the entered values to the beginning of the existing data for that field. However, I get the following error:

The data types varchar and nvarchar(max) are incompatible in the '&' operator.

Open in new window


How can I achieve the same result as I had with Access in MSSQL?

Thank you
SOLUTION
Avatar of davidi1
davidi1
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of stressfreewebs
stressfreewebs

ASKER

Thanks to the pointer I was able to work a full solution