Alternative way to DetDate() function?
Answers were Sorted based on User's Feedback
Answer / suraj
Selvaraj, You are wrong. I tested it.
Please, look at the output of these below queries.
'GetUTCDate' results in time difference which means it will
not give you the exact result as 'GETDATE()'.
SELECT GETUTCDATE()
-----------------------
2009-11-30 22:15:15.243
SELECT GETDATE()
-----------------------
2009-11-30 16:15:15.243
SELECT CURRENT_TIMESTAMP
-----------------------
2009-11-30 16:15:15.243
Is This Answer Correct ? | 4 Yes | 0 No |
Answer / vadivu
SELECT CURRENT_TIMESTAMP
(just searched in Help of SQL Server 2005)
Is This Answer Correct ? | 4 Yes | 1 No |
Answer / rajesh.a
Hi Selvaraj,
It is clearly seems to be a spelling mistake.so,stop pointing out such silly mistakes.Any one can knows that he is asking about getdate()
Is This Answer Correct ? | 1 Yes | 0 No |
First you Clearly Learn.It's GetDATE() function, Not DetDate
() function.
In SQL Server 2000 Query :
--------------------------
Select GetDate()
Output:
------
2008-01-22 17:37:20.280
Alternate to GetDate() function:
--------------------------------
Select GetUTCDate()
Output:
-------
2008-01-22 17:37:20.280
GetUTCDATE() means Greenwhich Mean Time of Current Date
Time.
Is This Answer Correct ? | 1 Yes | 1 No |
Answer / brahma prakash
SELECT current_date(for currentdate only)
SELECT NOW()
Is This Answer Correct ? | 0 Yes | 3 No |
Write the syntax for stuff function in an sql server?
How can you list all the columns in a database?
what is integrated security (SSPI). why we use in the connection string?
Why do we use trigger?
* CREATE TABLE [dbo].[t_Colors]([ColorId] [int] NOT NULL,[ColorName] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [ColorDesc] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,[ColorIndex] [int] NULL) ON [PRIMARY] GO * insert into [t_Colors] values(101,'Red','',1) insert into [t_Colors] values(101,'Red1','',2) insert into [t_Colors] values(102,'Blue','',1) insert into [t_Colors] values(102,'Blue1','',2) insert into [t_Colors] values(102,'Blue2','',3) * In this table i need to delete DELETE FROM t_Colors WHERE ColorIndex=1 AND ColorId=102 After delete above condition i need to update the ColorIndex set to 1 for Blue1[ColorName] and 2 for Blue2[ColorName] select * from [t_Colors] Note:- how can i get updates the ColorIndex values after delete. for example we need to update Blue1 ColorIndex set to 1 and Blue2 ColorIndex set to 2
How to verify the port number of the sql server?
How to execute stored procedure in select statement sql server?
Wht is Stuff in sql ser
How to test values returned by a subquery with the in operator?
What is the difference between ROW_NUMBER and Ranking function in SQL SERVER?
What is normalization?
How can you set the threshold at which sql server will generate keysets asynchronously?