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 |
|
CSK
Constraint Violating Yak Guru
489 Posts |
Posted - 2006-05-25 : 02:45:58
|
| Dear AllThe following statement taking more time(this query is in while loop )the table tmp_one having clustered index on sno columnUPDATE tmp_one SET amount = STUFF(amount,1,0,' ')WHERE DATALENGTH(LTRIM(amount)) < 5 + @pamtAND tmp_one .sno = @snois there any wrong with my query. Please give me ur valuable suggessionThanksKK |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-05-25 : 07:11:11
|
| How many rows does the table have?What is the datatype of amount column?MadhivananFailing to plan is Planning to fail |
 |
|
|
Srinika
Master Smack Fu Yak Hacker
1378 Posts |
Posted - 2006-05-25 : 09:06:46
|
| Ur While loop may be causing the time killingDo u have a few values for @pamt, & @sno ?Can't u add that calculation to the Query itself ?Is this in a cursor ?If u can place the While loop as well, v may be able to help u.Srinika |
 |
|
|
|
|
|