Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
Log in  ::  Register  ::  Not logged in

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Is_Leap Function

By Maysarah Abu-Laban,

Example 1:

After creating the function copy this into your Query Pane

dbo.Is_Leap (1800) AS [1800],
dbo.Is_Leap (1900) AS [1900],
dbo.Is_Leap (2000) AS [2000],
dbo.Is_Leap (2004) AS [2004],
dbo.Is_Leap (2008) AS [2008]

Example 2:

After creating the function copy this into your Query Pane

Print dbo.Is_Leap (2009)

Total article views: 849 | Views in the last 30 days: 2
Related Articles

Function Hell

The curses of dynamic sql


Changing DB_CHAIN Can Clear the Plan Cache

If you make changes to the settings of a database, it can cause the procedure cache to be cleared. M...


Add same foreign key constraint_name to more then one column

Hello, I have table named 'a' that have 2 columns 'aa' and 'cc' corresponding to 2 PK columns in...


Server: Msg 306,.....The text, ntext, and image data.......????????????????

Comparing between tables, I have found out that some of them result in an error like: The text, nte...



Hello, I have wrote one store proc. So, in the stored procedure, it is using one table which is i...


Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones