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 |
junior6202
Starting Member
45 Posts |
Posted - 2014-10-16 : 11:35:32
|
Hi All,Im a newbie to tsql and I wanted to see if anyone can help me write a query that will grab bin# from table A and if its missing on table B copy it. I tried and update query but it doesn't work and also a select Into and failed too. Table_A idx Bin 1 CSR010101A 2 CSR010101B 3 CSR010102A 4 CSR010102B 5 CSR010201A 6 CSR010201B 7 CSR010202A 8 CSR010202B Table_Bidx Bin 1 CSR010101A 2 CSR010101B 3 Null 4 Null 5 CSR010201A 6 Null 7 CSR010202A 8 NUll |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2014-10-16 : 12:02:51
|
update Bset Bin = a.Binfrom Table_B bjoin Table_A a on b.idx = a.idxwhere b.Bin is nullTara KizerSQL Server MVP since 2007http://weblogs.sqlteam.com/tarad/ |
|
|
|
|
|