You are here: Re: simple userdefined function question. « MsSQL Server « IT news, forums, messages
Re: simple userdefined function question.

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация