There is an existing table in database where I want to update one column. If I right click on the table—>select edit 200 rows and try to edit the cell data it says that the cell is read-only. I am using SQL management studio 2008R2.
So I was trying to update it using an update Query but I am pretty new to the SQL queries and the whole database thing. Is this the proper way to pass an HTML tag in queries?
UPDATE OutputTemplate
SET emailText='(<p>Thank you for your gift of {Amount} to the {CommunityName}</p><br />Support & Charity Campaign.<br />
--------------------------------------------
--- Transaction Detail ---
--------------------------------------------
<span>Credit Card Details</span>
<span style="text-decoration: underline;">Personal Info Details & Amount</span>)'
WHERE id='2'
It’s showing some parsing error, incorrect syntax while executing the query.
Sorry to ask such a basic question but I tried to google it, unfortunatelly nothing showed up useful.
Thanks
Remove the newlines from the query.
UPDATE OutputTemplateSET emailText="<p>Thank you for your gift of {Amount} to the {CommunityName}</p><br />Support & Charity Campaign.<br />--------------------------------------------<br />--- Transaction Detail ---<br />--------------------------------------------<br /><span>Credit Card Details</span><br /><span style="text-decoration: underline;">Personal Info Details & Amount</span>"
WHERE id='2'