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 |
|
nvakeel
Yak Posting Veteran
52 Posts |
Posted - 2008-02-11 : 13:13:02
|
| DECLARE @TABLE1 tABLE ( NUM iNT , VAL vARCHAR(10))declare @vir varchar(10) iNSERT INTO @TABLE1 vALUES (1,'JJ')iNSERT INTO @TABLE1 vALUES (2,'J')iNSERT INTO @TABLE1 vALUES (3,'JJJ')--sELECT * FROM @TABLE1update @table1Set Num = 3, Val = (select @vir = 'jj') can you tell me is this approach correct ? |
|
|
hey001us
Posting Yak Master
185 Posts |
Posted - 2008-02-11 : 13:53:45
|
| should be like this?update @table1 set val = 'jj' where num = 3hey |
 |
|
|
hey001us
Posting Yak Master
185 Posts |
Posted - 2008-02-11 : 13:54:48
|
| Or update @table1 set val = @vir where num = 3hey |
 |
|
|
|
|
|