sql语句

select lastrun into #temp 

from dbo.spt_monitor

select * from #temp





BEGIN TRY

  BEGIN TRAN

         select lastrun into #temp 

                from dbo.spt_monitor

          select * from #temp

  COMMIT TRAN

  END TRY

  

  --如果同步过程中出错,则事务回滚,并且记录数据库返回的错误信息和出错的数据的ID

  BEGIN CATCH

  ROLLBACK

          drop table Temp

  END CATCH

你可能感兴趣的:(sql语句)