What is the output of SELECT 'Current DATE is : ' + GETDATE() ?

 Posted by Bandi on 9/30/2013 | Category: Sql Server Interview questions | Views: 2982 | Points: 40
Select from following answers:
  1. Error
  2. Current DATE is : <DATE TIME value>
  3. it will display current date and time depends on version of SQL Server; if version is 2012 then option2 else option1
  4. None
  5. All Above

Show Correct Answer


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Posted by: Schatak on: 10/17/2013 | Points: 10
Ans: It will give error

To get output you need to Cast GETDATE()or Convert GETDATE()

Option 1:SELECT 'Current DATE is : ' + CAST(GETDATE() as varchar(50))
Option 2: SELECT 'Current DATE is : ' + convert(varchar(50),(GETDATE()))


Login to post response