Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need some advice
Message
From
23/03/2000 17:17:09
 
 
To
23/03/2000 09:13:35
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Miscellaneous
Thread ID:
00348846
Message ID:
00349703
Views:
31
>The query sp did run with correct results.
>Microsoft has room for imperfect like me.

I'm really surprised.

>
>UPDATE #db_ledger SET balance =
> (SELECT SUM(glamnt) FROM #db_ledger d WHERE d.gldt < #db_ledger.gldt)
>
>There can be more than one record on same day so the update function I think may not work.

As long as the time component is included in gldt, there shouldn't be a problem.

>Does the extra update for the balance have any overhead over the query time.
>(How much overhead for 10000 records approx.) How can I measure it.
>
>Is there any other way to frame the same query without the temp table & can the balance updation be set as a contraint over the table.

There are no constraint that provides a means to maintain calculated data. You could do it with a trigger but you still must have a way to serialize the transaction records.

-Mike
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform