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 |
JohnDW
Starting Member
45 Posts |
Posted - 2013-12-02 : 08:31:38
|
I have 2 tables: table1 with columns column1(PK,int,notnull),column2(nvarchar(30),null),column3(smallint,null)table2 with columns column1(nvarchar(40),null),column2(smallint,null).I want to update table1.column2 with the data from table2.column1where table1.column3 = table2.column2I have an updatequery like this:UPDATE table1SET table1.column2 = table2.column1FROM table1INNER JOIN table2ON table1.column2 = table2.column1WHERE table1.column3 = table2.column2But this doesn' work.Any advice?Johnif you do not try, it will not work |
|
nigelrivett
Master Smack Fu Yak Hacker
3385 Posts |
Posted - 2013-12-02 : 09:34:04
|
UPDATE table1SET column2 = table2.column1FROM table1INNER JOIN table2ON table1.column3 = table2.column2==========================================Cursors are useful if you don't know sql.SSIS can be used in a similar way.Beer is not cold and it isn't fizzy. |
|
|
JohnDW
Starting Member
45 Posts |
Posted - 2013-12-02 : 10:23:57
|
Yes!Txs A LOT!Johnif you do not try, it will not work |
|
|
|
|
|