Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How to copy contents of field

Author  Topic 

Topaz
Posting Yak Master

199 Posts

Posted - 2008-10-09 : 05:04:42
I need to copy some data from a field but not sure how you do it?

any ideas.

This place is a SQL wonderland!!

JT

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-09 : 05:05:41
copy to where?
Go to Top of Page

Topaz
Posting Yak Master

199 Posts

Posted - 2008-10-09 : 05:08:50
same database but to another field

JT
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-09 : 05:14:15
UPDATE Table
SET DestField=SourceField
WHERE yourconditions
Go to Top of Page

Topaz
Posting Yak Master

199 Posts

Posted - 2008-10-09 : 10:08:44
would this work then?

UPDATE Table_name
SET mail17date=mail17date2
WHERE blank like '1045'

JT
Go to Top of Page

Topaz
Posting Yak Master

199 Posts

Posted - 2008-10-09 : 11:06:51
the above yay or nay?

JT
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-09 : 12:08:39
quote:
Originally posted by Topaz

would this work then?

UPDATE Table_name
SET mail17date=mail17date2
WHERE blank like '1045'

JT


if you are using like use wildcards in which case it will update all columns where value contains pattern 1045 anywhere in it.
And if your reqmnt is to update only those records having blank value as 1045 use = instead of like
Go to Top of Page
   

- Advertisement -