Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 error while creating function on remote server

Author  Topic 

saurabhpandey84
Starting Member

5 Posts

Posted - 2008-06-07 : 05:36:33
i have a function:
Create Function ReturnAmountB(@CMID int) Returns Decimal
as
BEGIN
declare @Return decimal
select @Return =sum(PD_PaymentAmount) from Payment_Details where
PD_IsRefund=1 and PD_PaymentType=0 and PD_CMID=@CMID
return @Return
END

when i run this on server(remote) this error shows...
Incorrect syntex near 'Function'
Must declare the variable '@CMID'
A RETURN statement with a return value cannot be used in this context

i am not able to understand why this error shows...
one thing more on local server there is no errors occures....!!!
Any solution!!!

spandey

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-06-07 : 06:06:41
Please dont cross post:-

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=104373
Go to Top of Page
   

- Advertisement -