[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

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

Posted on 2008-06-16
2
Medium Priority
?
682 Views
Last Modified: 2012-05-05
How do we update a column in SQL database without overwriting the existing data?
0
Comment
Question by:Anandhi1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 750 total points
ID: 21795697
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
 
LVL 8

Expert Comment

by:i2mental
ID: 21795723
update table1
set field1 = 'whatever' where field1 is null

only writes into blank field1
0

Featured Post

Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windocks is an independent port of Docker's open source to Windows.   This article introduces the use of SQL Server in containers, with integrated support of SQL Server database cloning.
One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question