SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 using replace
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

rjhe22
Posting Yak Master

233 Posts

Posted - 03/13/2013 :  08:21:10  Show Profile  Reply with Quote
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 - 03/13/2013 :  08:25:20  Show Profile  Reply with Quote
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
Posting Yak Master

233 Posts

Posted - 03/13/2013 :  08:34:29  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000