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

  • Getting “SQLExpress database file auto-creation error” for site that uses AspNetSqlMembershipProvider, but connection string is to SQL Server 2005
  • How can I use a single mssql connection pool across several routes in an Express 4 web application?
  • DATEDIFF() or BETWEEN for Date Ranges in SQL Queries
  • SQL - aggregate function - GROUP BY clause
  • How to Insert Records based on the Previous Insert?
  • Determine SQL Server Database Size
  • How to write a cursor inside a stored procedure in SQL Server 2008
  • Find a series of data using non-exact measurements (fuzzy logic)
  • SQL query for returning the latest record for each ID
  • How do we change the page size of SQL Server?
  • Moving Average / Rolling Average
  • Driver.getConnection hangs using SQLServer driver and Java 1.6.0_29
  • 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.