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 |
|
Zoma
Yak Posting Veteran
76 Posts |
Posted - 2010-02-04 : 09:08:00
|
| One of my developers asked me to update a culumn.The table name is Bullet_Item and the culumn name is Desc_DBSource.The Data in it is "DataSource=server02" in all rows like 400 of them.I want to change "DataSource=server02" to "SQL2005" in all rows!I hve tried this statementselect table nameupdate "DataSource=server02" = "sql2005"gobut somehow it dsnt work. I just wana change the field DataSource=server02 to sql 2005Please help |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2010-02-04 : 09:12:37
|
[code]update tset Desc_DBSource = 'sql2005'from Bullet_Item twhere Desc_DBSource = 'DataSource=server02'[/code]or maybe you want to replace part of the string ?[code]update tset Desc_DBSource = replace(Desc_DBSource, 'DataSource=server02','sql2005')from Bullet_Item twhere Desc_DBSource like '%DataSource=server02%'[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
Lumbago
Norsk Yak Master
3271 Posts |
Posted - 2010-02-04 : 09:12:48
|
| UPDATE Bullet_Item SET Desc_DBSource = 'sql2005'At your own risk though...and you should probably look at www.w3schools.com/sql when you have some spare time. This is as basic as it gets.- LumbagoIf the facts don't fit the theory, change the facts. Albert Einstein |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-02-04 : 09:13:46
|
| [code]update Bullet_Item set Desc_DBSource ='SQL2005' where Desc_DBSource='DataSource=server02'[/code] |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-02-04 : 09:14:11
|
|
 |
|
|
Zoma
Yak Posting Veteran
76 Posts |
Posted - 2010-02-05 : 01:28:57
|
| Thanks a lot guys. It really helped. Now i can put more trust :). Life savers! |
 |
|
|
|
|
|