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 |
|
Sudha1234567
Starting Member
5 Posts |
Posted - 2009-08-31 : 09:54:41
|
| I has to update the table temp as belowID NAME1 System12 System23 System34 NULL5 NULL6 System57 System6The ID 4 Name has to be Updated wih the Next greatest Value which has Name NOT NULL |
|
|
Nageswar9
Aged Yak Warrior
600 Posts |
Posted - 2009-08-31 : 09:57:09
|
| update tableset name = 'system'+right(name,1)+1where id = 4or update tableset name = 'system'+cast(id as varchar(32))where name is null |
 |
|
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
Posted - 2009-08-31 : 10:25:12
|
| declare @id int select @id = max(id) from tablenameselect 'system' + cast( @id as varchar(32)) |
 |
|
|
|
|
|