Thursday, 12 August 2010

SQL Server timestamp

Getting timestamp as yyyymmddhhmmSSsss

DECLARE @sTime VARCHAR(255)
SET @sTime=REPLACE(REPLACE(REPLACE(REPLACE(CONVERT(VARCHAR(23), GETDATE(), 121),'-',''),' ',''),':',''),'.','')
SELECT @stime

No comments: