Click here to Skip to main content
15,910,358 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Can any one help me to create function in sql server 2012 ,I M new in sql it shows error [invalid use of side-effecting operator 'select' within a function]

CREATE FUNCTION Get_RearEnd_Outflow( @I_TXN_ID INT)
RETURNS int
AS BEGIN
DECLARE @V_COUNT INT
SELECT COUNT(*) INTO @V_COUNT FROM IRR_CHARGES_M
RETURN @V_COUNT
END
Posted

1 solution

Change select as shown below and then try.

SQL
SELECT @V_COUNT=COUNT(*) FROM IRR_CHARGES_M
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900