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 |
|
mdhingra01
Posting Yak Master
179 Posts |
Posted - 2004-03-24 : 15:25:19
|
| is there away to update mulitple columns in one statment either using update or case?Thanks |
|
|
ditch
Master Smack Fu Yak Hacker
1466 Posts |
Posted - 2004-03-24 : 15:28:56
|
| UPDATE MyTableSET Col1 = 'NewVal', Col2 = 'NewVal'Duane. |
 |
|
|
mdhingra01
Posting Yak Master
179 Posts |
Posted - 2004-03-24 : 15:31:32
|
| What if NewVal1 and NewVal2 are coming from another table is this still possible?thanks Duane! |
 |
|
|
JustinBigelow
SQL Gigolo
1157 Posts |
Posted - 2004-03-24 : 15:49:09
|
| More than one table can be involved in an update if you updating a view.Justin"Hit me with a shovel 'cause I can't believe I dug you." |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2004-03-24 : 15:56:02
|
| [code] UPDATE a SET Col1 = b.Col1 , Col2 = b.Col2 FROM Table1 aINNER JOIN Table2 b ON a.[id] = b.[id][/code]Brett8-) |
 |
|
|
mdhingra01
Posting Yak Master
179 Posts |
Posted - 2004-03-24 : 16:02:20
|
| Thanks guys for the help.I appreciate it.;c) |
 |
|
|
|
|
|