I am trying to search the table actions in my database and delete any value within the code column that has the value of 40.
I have tried:
REPLACE (code,40,'')
FROM actions
but no luck. Also tried the DELETE function.
I am trying to search the table actions in my database and delete any value within the code column that has the value of 40.
I have tried:
REPLACE (code,40,'')
FROM actions
but no luck. Also tried the DELETE function.
You're looking for UPDATE:
Update actions
Set code = Null
Where code = 40
If you need to delete the entire row, you can do it with the following:
Delete
From actions
Where code = 40
NOT NULL constraint on your column that you're trying to set to NULL. You will either need to update the column definition, or set the value to something other than NULL (i.e. 0 or -1 - this depends on your data and how you use it.)TRANSACTION before running it, then verifying that you get what you need before you COMMIT it. It's a whole lot easier to ROLLBACK than it is to restore from a backup.