How to print GETDATE() in SQL Server with milliseconds in time?

前端 未结 7 592
情书的邮戳
情书的邮戳 2021-02-03 16:49

I want to print GETDATE() in SQL Server 2008, I need the time with milliseconds (this is for debugging purpose - to find sp\'s execution time )

I find this Difference

7条回答
  •  庸人自扰
    2021-02-03 17:04

    these 2 are the same:

    Print CAST(GETDATE() as Datetime2 (3) )
    PRINT (CONVERT( VARCHAR(24), GETDATE(), 121))
    

提交回复
热议问题