• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 687
  • Last Modified:

Sql query to update a column without overwriting the existing data.

How do we update a column in SQL database without overwriting the existing data?
0
Anandhi1
Asked:
Anandhi1
1 Solution
 
Aneesh RetnakaranDatabase AdministratorCommented:
i didbt understand, you mean to update a paticular column with entirely new value in that case try this

update urTable
set urColumn = 'newValue'
 where somePrimarykey = 'someUniqueValue'

if you want to append to the exisitng one

update urTable
set urColumn = urColumn +  'newValue'
 where somePrimarykey = 'someUniqueValue'
0
 
i2mentalCommented:
update table1
set field1 = 'whatever' where field1 is null

only writes into blank field1
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now