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
 General SQL Server Forums
 New to SQL Server Programming
 writing function

Author  Topic 

pavan23
Starting Member

1 Post

Posted - 2011-03-12 : 17:04:07
hi i am learning sql server....can i know how to write a function to identify the number is even or odd....


thank you in advance....

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2011-03-12 : 17:07:27
create function dbo.fnIsOdd
(
@theNumber INT
)
RETURNS BIT
AS
BEGIN
RETURN @theNumber % 2
END



N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page
   

- Advertisement -