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 |
|
00kevin
Yak Posting Veteran
78 Posts |
Posted - 2010-05-25 : 09:19:48
|
| Hi,I have a table (table1) with several columns that are updated constantly from a .net application. Sometimes several updates occur per second.I also have a procedure that uses the values in Table1 to perform some calculations and it insert the results into Table2The problem is that the results of the calculations are sometimes 0 when they shouldn't be. Each time I run the procedure to perform the calculations different columns in table2 end up having zeros. the zeros are the results of nullif(x,0) in the equation.I'm not sure if this is some kind of timing issue or locking problem. There are transactions around every update to the first table and every update to the second table. How do I solve this issue? |
|
|
Sachin.Nand
2937 Posts |
Posted - 2010-05-25 : 09:36:12
|
| I doubt the zeroes are because of nullif(x,0).Because if x is 0 then function nullif will return NULL and if x is not zero then it will return the value of x.PBUH |
 |
|
|
00kevin
Yak Posting Veteran
78 Posts |
Posted - 2010-05-25 : 09:38:45
|
| yes you are correct... I got my functions confused. the calculation is using isnull(x,0) |
 |
|
|
Sachin.Nand
2937 Posts |
|
|
|
|
|