SQL サーバーで特定のエラー コードをトラップするコードをテストしようとしています。エラー コードは 7886 です。
しようとするとTHROW
、次のようになります。
Error number 7886 in the THROW statement is outside the valid range. Specify an error number in the valid range of 50000 to 2147483647.
しようとするとRAISERROR
、次のようになります。
Error number 7886 is invalid. The number must be from 13000 through 2147483647 and it cannot be 50000.
そもそもエラーを引き起こす状況を実際に設定せずに、このような任意のエラーを発生させる方法はありますか?