Getting the current date in SQL Server?

This question already has an answer here:

  • How do I get just the date when using MSSQL GetDate()? [duplicate]

    7 answers

  • How do I create a temporary table for a dynamic query so that I can BCP the output
  • What is a page in SQL Server and do I need to worry?
  • Entity Framework - Eagerly load object graph using stored procedures
  • SQL Query time spent between certain value
  • Create “Default Values or Binding” for new coumn having Data-Type of DateTimeOffset(7)?
  • Join between distinct datasources on SSRS
  • How to get level and count for item in recursive query
  • SQL Server - Displaying joined rows as columns
  • Read only access to stored procedure contents
  • SQL Server 2008 Query Result to XML FIle
  • The query processor ran out of internal resources exception
  • With SQL Server add x number of days to a date in sql but also pass in the number of business days in a week
  • 2 Solutions collect form web for “Getting the current date in SQL Server?”

    SELECT CAST(GETDATE() AS DATE)
    

    Returns the current date with the time part removed.

    DATETIMEs are not “stored in the following format”. They are stored in a binary format.

    SELECT CAST(GETDATE() AS BINARY(8))
    

    The display format in the question is independent of storage.

    Formatting into a particular display format should be done by your application.

    As you are using SQL Server 2008, go with Martin’s answer.

    If you find yourself needing to do it in SQL Server 2005 where you don’t have access to the Date column type, I’d use:

    SELECT DATEADD(DAY, DATEDIFF(DAY, 0, GETDATE()), 0)
    

    SQLFiddle

    MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.