error handling inside db

0

Please login or register to vote for this query.

(click on this box to dismiss)

sede_ineachdb

Artificial Intelligence

Q&A for people interested in conceptual questions about life and challenges in a world where "cognitive" functions can be mimicked in purely digital environment

exec dbo.sede_ineachdb @sqlcommand = N'
BEGIN TRY  
    select 1 [one] from [data.stackexchange].dbo.sites;
END TRY  
BEGIN CATCH  
     SELECT  
    ERROR_NUMBER() AS ErrorNumber  
    ,ERROR_SEVERITY() AS ErrorSeverity  
    ,ERROR_STATE() AS ErrorState  
    ,ERROR_PROCEDURE() AS ErrorProcedure  
    ,ERROR_LINE() AS ErrorLine  
    ,ERROR_MESSAGE() AS ErrorMessage;  
END CATCH  
',
  @includemainmeta = 1,
   @CollectResultsForMe = 0

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results