How to get Date only from the datetime value?

SELECT CONVERT(VARCHAR(10), getdate(), 101); Outputs in mm/dd/yyyy SELECT CAST(getdate() AS date); To get the current date time: SELECT getdate(); SELECT CURRENT_TIMESTAMP; Other related functions: ELECT CONVERT (time, SYSDATETIME()) ,CONVERT (time, SYSDATETIMEOFFSET()) ,CONVERT (time, SYSUTCDATETIME()) ,CONVERT (time, CURRENT_TIMESTAMP) ,CONVERT (time, GETDATE()) ,CONVERT (time, GETUTCDATE()); /* Returned SYSDATETIME() 13:18:45.3490361 SYSDATETIMEOFFSET()13:18:45.3490361 SYSUTCDATETIME() 20:18:45.3490361 Read more…

SQL Server Database Mail – Diagnose and Resolve Issues

To Check the mail service status EXEC msdb.dbo.sysmail_help_status_sp; To Stop and Restart Mail Queue/ Service EXEC msdb.dbo.sysmail_stop_sp;EXEC msdb.dbo.sysmail_start_sp; To Check Sent and Unsent Email SELECT * FROM msdb.dbo.sysmail_sentitems;SELECT * FROM msdb.dbo.sysmail_unsentitems; To manually send a test email EXEC msdb.dbo.sp_send_dbmail @profile_name = ‘Default Profile’, @recipients = ‘yourame@yourDmain.com’, @subject = ‘Try #1 Read more…