/*
说明:通过set language指定语种语言,使sql server的报错以该语种语言的形式呈现
脚本来源:https://www.cnblogs.com/zhang502219048/p/12826544.html
参考:https://docs.microsoft.com/zh-cn/sql/t-sql/statements/set-language-transact-sql?view=sql-server-2017
参考表:select * from sys.syslanguages
*/
--Divide by zero error encountered.
set language US_ENGLISH
begin try
declare @i int = 1 / 0
end try
begin catch
select ERROR_MESSAGE() as ErrorInfo
end catch
go
--遇到以零作除数错误。
set language 简体中文
begin try
declare @i int = 1 / 0
end try
begin catch
select ERROR_MESSAGE() as ErrorInfo
end catch
go
--發現除以零的錯誤。
set language 繁體中文
begin try
declare @i int = 1 / 0
end try
begin catch
select ERROR_MESSAGE() as ErrorInfo
end catch
go
--0 除算エラーが発生しました。
set language 日本語
begin try
declare @i int = 1 / 0
end try
begin catch
select ERROR_MESSAGE() as ErrorInfo
end catch
go
--0으로 나누기 오류가 발생했습니다.
set language 한국어
begin try
declare @i int = 1 / 0
end try
begin catch
select ERROR_MESSAGE() as ErrorInfo
end catch
go