Posted by Erland Sommarskog on 10/19/05 00:50
[posted and mailed, please reply in news]
parez (psawant@gmail.com) writes:
> This is the first time i am tryin to write a sql server 2000 function.
> I need to clean up some of my stored procedures..
>
> Can any one please give me skeleton for a userdefined function or
> correct my function. I get the following error.
>
> Select statements included within a function cannot return data to a
> client.
Looks like a simple syntax error to me:
> CREATE FUNCTION GoodAd
> (@adid int,@currentdate datetime)
> RETURNS bit
> AS
> BEGIN
> declare @Return bit
> select @return = 1
>
> if exists (select null from adqas where adid=@adid)
> select @return 0
I guess you mean:
select @return = 0
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp
[Back to original message]
|