Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Server : cannot update column in table

Tags:

sql-server

I cannot work out why my column is not being updated.

I have added a new column to an existing table as follows:

ALTER TABLE dbname..tablename 
  ADD RejectedCode [varchar](5) NULL

When I run the query below:

UPDATE dbname..tablename 
SET RejectedCode = 'OTHER',
    Notes = 'DEBUG'
WHERE RecordID = 12345

it says:

(1 row(s) affected)

I check the respective record and I can see the Notes column updated, but the new column still displays NULL and I don't get any error message.

What am I doing wrong? Many thanks for help.

like image 231
user2430797 Avatar asked Apr 21 '16 06:04

user2430797


Video Answer


1 Answers

Looks like you have trigger instead of update on your table

like image 93
Ruslan K. Avatar answered Oct 23 '22 03:10

Ruslan K.