我已经链接了需要更新的服务器。
BEGIN TRY
delete [SDNY-PAND\BarCode].Barcodes.dbo.barcodes
where Plant_Location <> 'Jefferson, GA123'
-- bla bla bla
END TRY
BEGIN CATCH
--print ' in error now'
set @strBody = 'It appears that the server that holds the barcode data
is currently unavailable. Please validate that it is plugged in
and turned on for IS'
set @MailTo = 'ThatGroup@work'
set @ESubject = 'Message from Barcode Server Update Process'
EXEC msdb.dbo.sp_send_dbmail
@recipients =@MailTo,
@body = @strBody,
@body_format ='TEXT',
@subject = @ESubject,
@profile_name ='ColossusMain'
END CATCH
请问这个过程还是有更好的方法?