• twin.devil (4/24/2014)


    1) create a custom unique number (like combination of DateTime plus any other Alpha/numeric number)

    Something along these lines? (ugly but works) 😎

    (121 retains the milliseconds while 126 and 127 truncate them if the millisecond value is 0.)

    SELECT REPLACE(REPLACE(REPLACE(REPLACE(CONVERT(VARCHAR(40),DATEADD(HOUR,7978521,CONVERT(DATETIME2(2),SYSDATETIME())),121),'-',''),' ',''),':',''),'.','')