SQL Server obtains the Server time SQL statement, serversql

Source: Internet
Author: User

SQL Server obtains the Server time SQL statement, serversql

SQL server 2000 how to obtain the current system time using SQL statements

GETDATE ();

GetDate () in SQL ()

A very powerful date Formatting Function in SQL Server

Select CONVERT(varchar(100), GETDATE(), 0): 05 16 2008 10:57AMSelect CONVERT(varchar(100), GETDATE(), 1): 05/16/08Select CONVERT(varchar(100), GETDATE(), 2): 08.05.16Select CONVERT(varchar(100), GETDATE(), 3): 16/05/08Select CONVERT(varchar(100), GETDATE(), 4): 16.05.08Select CONVERT(varchar(100), GETDATE(), 5): 16-05-08Select CONVERT(varchar(100), GETDATE(), 6): 16 05 08Select CONVERT(varchar(100), GETDATE(), 7): 05 16, 08Select CONVERT(varchar(100), GETDATE(), 8): 10:57:46Select CONVERT(varchar(100), GETDATE(), 9): 05 16 2008 10:57:46:827AMSelect CONVERT(varchar(100), GETDATE(), 10): 05-16-08Select CONVERT(varchar(100), GETDATE(), 11): 08/05/16Select CONVERT(varchar(100), GETDATE(), 12): 080516Select CONVERT(varchar(100), GETDATE(), 13): 16 05 2008 10:57:46:937Select CONVERT(varchar(100), GETDATE(), 14): 10:57:46:967Select CONVERT(varchar(100), GETDATE(), 20): 2008-05-16 10:57:47Select CONVERT(varchar(100), GETDATE(), 21): 2008-05-16 10:57:47.157Select CONVERT(varchar(100), GETDATE(), 22): 05/16/08 10:57:47 AMSelect CONVERT(varchar(100), GETDATE(), 23): 2008-05-16Select CONVERT(varchar(100), GETDATE(), 24): 10:57:47Select CONVERT(varchar(100), GETDATE(), 25): 2008-05-16 10:57:47.250Select CONVERT(varchar(100), GETDATE(), 100): 05 16 2008 10:57AMSelect CONVERT(varchar(100), GETDATE(), 101): 05/16/2008Select CONVERT(varchar(100), GETDATE(), 102): 2008.05.16Select CONVERT(varchar(100), GETDATE(), 103): 16/05/2008Select CONVERT(varchar(100), GETDATE(), 104): 16.05.2008Select CONVERT(varchar(100), GETDATE(), 105): 16-05-2008Select CONVERT(varchar(100), GETDATE(), 106): 16 05 2008Select CONVERT(varchar(100), GETDATE(), 107): 05 16, 2008Select CONVERT(varchar(100), GETDATE(), 108): 10:57:49Select CONVERT(varchar(100), GETDATE(), 109): 05 16 200810:57:49:437AMSelect CONVERT(varchar(100), GETDATE(), 110): 05-16-2008Select CONVERT(varchar(100), GETDATE(), 111): 2008/05/16Select CONVERT(varchar(100), GETDATE(), 112): 20080516Select CONVERT(varchar(100), GETDATE(), 113): 16 05 2008 10:57:49:513Select CONVERT(varchar(100), GETDATE(), 114): 10:57:49:547Select CONVERT(varchar(100), GETDATE(), 120): 2008-05-16 10:57:49Select CONVERT(varchar(100), GETDATE(), 121): 2008-05-16 10:57:49.700Select CONVERT(varchar(100), GETDATE(), 126): 2008-05-16T10:57:49.827Select CONVERT(varchar(100), GETDATE(), 130): 18 ???? ?????? 142710:57:49:907AMSelect CONVERT(varchar(100), GETDATE(), 131): 18/04/142710:57:49:920AM

Obtain the SQL Server time

Insert into tablename (Date) value getDate ()

"Select getdate () as serverDate"
Then read the serverDate attribute, that is, the SQL Server time.

It can also be obtained directly using the following statement:
Select getdate ()
Select CURRENT_TIMESTAMP

The obtained time is in the following format:
14:07:15. 670

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.