SQL Server 2000 - Which part of the code line generates error in the below user-defined function?

CREATE FUNCTION [dbo].[SampleFunction]
RETURNS DATETIME
AS
BEGIN
DECLARE @TodaysDate DATETIME
SET @TodaysDate = GETDATE()
SET @TodaysDate = DATEADD(DD, DATEDIFF(DD, 0, @TodaysDate), 0)

RETURN @TodaysDate
END

 Posted by Bandi on 6/26/2015 | Category: Sql Server Interview questions | Views: 1874 | Points: 40
Select from following answers:
  1. SET @TodaysDate =
  2. SET @TodaysDate = GETDATE()
  3. No Error
  4. RETURN @TodaysDate
  5. All Above

Show Correct Answer


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response