O'Reilly logo

Microsoft SQL Server 2012 T-SQL by Debra Aaron, Tom Coffing

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 7 – Date Function

"An inch of time cannot be bought with an inch of gold."

- Chinese Proverb

Current_Timestamp

images

Above is the keyword Current_Timestamp that allows a user to get the timestamp. This is a reserved word and so the system will deliver the timestamp to you when requested.

Getdate

This example uses the Getdate() function to return the timestamp.

SELECT Getdate() as "The Date";

The Date

------------

03/30/2015 8:46:04.567

“Speak in a moment of anger and you’ll deliver the greatest speech you’ll ever regret.”

– Anonymous

The Getdate command will return today’s date and time just like the Current_Timestamp command. This is ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required