Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Illegal use of update within a function
Message
From
07/05/2004 08:53:25
 
 
To
07/05/2004 04:26:52
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00901468
Message ID:
00901894
Views:
39
>Any way around this?

I think I seen some tricks where people use OPENDATASOURCE. Why can't you use a stored procedure?

-Mike

>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
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Previous
Reply
Map
View

Click here to load this message in the networking platform