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.
Author |
Topic |
StacyOW
Yak Posting Veteran
93 Posts |
Posted - 2013-10-12 : 01:24:20
|
I have two tables. They both have an identity field to join them together. One of the tables has a column of data that I want to put in the other table. I need to make sure the data is brought over using the join so it updates that column for the right record.I am struggling with this. Should I use a update or an insert? I'm leaning toward update but I can't figure out how with the join.Any help would be much appreciated.This is what I have tried so far:Update grpcon.GroupID = groups.GroupIDfrom grpcon Inner Join groupson grpcon.GroupNum=groups.GroupNum |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-10-12 : 03:59:16
|
[code]Update gSET g.GroupID = gp.GroupIDfrom grpcon g Inner Join groups gpon g.GroupNum=gp.GroupNum[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
|
|
|