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 |
mahdi87_gh
Yak Posting Veteran
72 Posts |
Posted - 2010-09-27 : 15:17:27
|
hi every bodyhow can i convert this statements to few line statement? something like loop or i don't know!!!update formTahavol set v80=v77update formTahavol set v79=v76update formTahavol set v78=v75update formTahavol set v87=v74update formTahavol set v86=v73update formTahavol set v85=v72update formTahavol set v84=v71....update formTahavol set v47=v44update formTahavol set v46=v42 thanks****<< I Love MTN.SH >>**** |
|
dinakar
Master Smack Fu Yak Hacker
2507 Posts |
Posted - 2010-09-27 : 18:10:41
|
You can merge them into oneUPDATE TableSET col1 = val1, col2= val2, col3 = vale,.....coln= valn unless you have different WHERE clauses for each of these UPDATEs.Dinakar Nethi************************Life is short. Enjoy it.************************http://weblogs.sqlteam.com/dinakar/ |
 |
|
mahdi87_gh
Yak Posting Veteran
72 Posts |
Posted - 2010-09-28 : 03:31:29
|
thanks for answerbut this is not what i want. i have a table formTahavol(v1,v2,v3,....,v77)now i want to add three columns after v42. so i must add v78,v79,v80 at the end of table, then i have to move data from v43-v77 to v46-v80****<< I Love MTN.SH >>**** |
 |
|
|
|
|