Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Illegal use of update within a function
Message
From
07/05/2004 04:26:52
 
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00901468
Message ID:
00901851
Views:
21
Hi Mike,

As always, terse and to the point :-)

Too bad, would have been nice.

Any way around this?


>You can't modify data in a table from within a UDF.
>
>-Mike
>
>>
>>-- @Discrepancy is a singleton from preceding select
>>
>>IF @Discrepancy <= 0 AND @IsStatus = 0
>>   BEGIN
>>      UPDATE CBInvoice
>>      SET IsStatus = 1
>>         WHERE ...
>>END
>>
>>
>>Discrepancy (calculated as subtract a -(b+c), where a,b and c are fields in CBInvoice) and IsStatus are both fields in CBInvoice.
>>
>>
>>TIA
Peter Pirker


Whosoever shall not fall by the sword or by famine, shall fall by pestilence, so why bother shaving?

(Woody Allen)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform