Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calculated Field
Message
From
14/07/2011 15:07:05
 
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Environment versions
SQL Server:
SQL Server 2008
Miscellaneous
Thread ID:
01518145
Message ID:
01518171
Views:
32
>>>>The problem I have is that I get Error Msg 444: Select statements included within a function cannot return data to a client which is due to my SELECT CIT_PK...
>>>>
>>>>How do I return that into a temporary table/cursor so that I can check the status of the claim items?
>>>
>>>It looks like you're overcomplicating the problem. I suggest to create a stored procedure rather than a function and do all the calculations there.
>>
>>What's the difference between the SP and the function? The logic I need to apply will be the same in both, won't it?
>
>Functions in T-SQL have many limitations that SP don't have. Say, you can not use DML statements in functions (except for operations with table variables), functions often don't provide good performance (especially for scalar functions or multi-line table valued functions).
>
>So, I recommend to lean towards stored procedures for complex logic and not try to abuse functions (although, of course, they do have their place).

so are you saying the code I wrote would work in an SP?
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform