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 |
|
Ramu27
Starting Member
2 Posts |
Posted - 2010-07-27 : 14:08:57
|
| I want to update a column called AYG in a table by name PGY.How to do update the value in this column by name AYG to 0 using SQL Server Enterprise manager 2005? |
|
|
slimt_slimt
Aged Yak Warrior
746 Posts |
Posted - 2010-07-27 : 14:10:26
|
| [code]update PGYset AYG = 0from PGY[/code] |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-07-27 : 14:14:06
|
quote: Originally posted by slimt_slimt
update PGYset AYG = 0from PGY
No need for that FROM clause but maybe a need for a WHERE clause  No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
slimt_slimt
Aged Yak Warrior
746 Posts |
Posted - 2010-07-27 : 14:17:32
|
you can use only:UPDATE PGYSET AYG = 0 or evenUPDATE PGYSET AYG = 0FROM PGYWHERE AYG = {some_condition} |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-07-27 : 14:19:05
|
or evenUPDATE PGYSET AYG = 0FROM PGYWHERE AYG = {some_condition} No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
Ramu27
Starting Member
2 Posts |
Posted - 2010-07-27 : 14:22:47
|
| Thanks for the script, Where do I enter this script? Sort of new to SQL Server 2005. Have used 2000 before, which was pretty simple. Please clarify |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-07-27 : 14:27:31
|
In SQL Server Management Studio in a query window. No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
slimt_slimt
Aged Yak Warrior
746 Posts |
Posted - 2010-07-27 : 14:43:01
|
| or even so :Dboth are correct :D |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
kashyap_sql
Posting Yak Master
174 Posts |
Posted - 2010-07-28 : 09:00:05
|
| niceWith RegardsKashyap M |
 |
|
|
|
|
|