In your
CONVERT( varchar, @starttime )
specify the correct
style[
^] you want, in your case style 121 should be used
CONVERT(varchar, @starttime, 121 )
You also need to added line feed to the message, use
CHAR( 13 )
for this.
So for the code you supplied use:
SET @msg = 'Job Started - ' + CONVERT( varchar, @starttime, 121 ) + CHAR( 13 ) + 'Job ended at ' + CONVERT( varchar, @endtime, 121 ) + CHAR ( 13 ) + @message.
To get the line feeds in the
@message
you should change the code were the value is inserted into the database.