Get Current System Date Time

Answer Posted / mohammadali.info

SELECT GETDATE() AS CurrentDateTime

SELECT 'SYSDATETIME' AS FunctionName, SYSDATETIME() AS DateTimeFormat
UNION ALL
SELECT 'SYSDATETIMEOFFSET', SYSDATETIMEOFFSET()
UNION ALL
SELECT 'SYSUTCDATETIME', SYSUTCDATETIME()
UNION ALL
SELECT 'CURRENT_TIMESTAMP', CURRENT_TIMESTAMP
UNION ALL
SELECT 'GETDATE', GETDATE()
UNION ALL
SELECT 'GETUTCDATE', GETUTCDATE()

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the differences between sql server and mysql.

757


What is the importance of a recovery model?

768


Where do we use trace frag?

731


How to list all objects in a given schema?

735


Which sql server is best?

723






Do comments need to go in a special place in sql server 2005?

648


What is a mixed extent?

756


How do you create an execution plan?

658


How to Improve the performencs of SQL Server 2005 exclude stored Procedure and Indexes?

1759


Can we use where clause with group by?

672


What are the types of joins in sql?

768


Can we take the full database backup in log shipping?

717


Define ACID properties in a Database?

799


What is the difference between grant and with grant while giving permissions to the user?

728


What is checkpoint in sql server?

811