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
 using replace

Author  Topic 

rjhe22
Constraint Violating Yak Guru

283 Posts

Posted - 2013-03-13 : 08:21:10
is it possible to replace data from one column to another in a table say table a
and also at the same time replace data from a column say in table b to a column in table a

Robowski
Posting Yak Master

101 Posts

Posted - 2013-03-13 : 08:25:20
Yes if there is a unique field you can link them between.

How do you have table a and b setup?

quote:
Originally posted by rjhe22

is it possible to replace data from one column to another in a table say table a
and also at the same time replace data from a column say in table b to a column in table a

Go to Top of Page

rjhe22
Constraint Violating Yak Guru

283 Posts

Posted - 2013-03-13 : 08:34:29
ya have uniqu key need it something like this but it wont work
i have found a few things on the net but they all do it different way and im not sure whats the right way.
the one i was following was somthing along these line

UPDATE dbo.TempSimulation
SET dbo.TempSimulation.ThirdSimulation = dbo.TempSimulation.ISIN,
generic.HistoricalPrice.ShareCurrency = dbo.TempSimulation.ShareCurrency
FROM dbo.TempSimulation
INNER JOIN generic.HistoricalPrice ON
dbo.TempSimulation.ThirdSimulation= hp.ISIN
Go to Top of Page
   

- Advertisement -