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

Posted by parez on 10/18/05 23:08

Hi All!

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.



This returns a bit and it does a query to the database to decide the
value of the bit





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


return @return
end

 

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

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