Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
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

SELECT
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: 1
 
Related Articles
FORUM

Function Hell

The curses of dynamic sql

BLOG

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...

FORUM

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...

FORUM

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...

FORUM

INVALID OBJECT NAME

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

 
Contribute