1、错误代码行

BEGIN TRY
    SELECT 1/0
END TRY
BEGIN CATCH
    THROW
END CATCH
2、二进制截断列名值

create table #ls(a varchar(1))
insert into #ls values('abc')

符串或二进制数据将在表“tempdb.dbo.#ls_00000000005B”,列“a”中被截断。截断值:“a”。

终于出来了,必须把数据库兼容性设置到2019。数据库名称>右键》兼容性》2019

chose语法

 

JSON 输出与查询解析json

select dm,ks from c_dept for json auto

select dm,ks from c_dept for json auto,root('data')
select dm,ks from c_dept for json path

select dm,ks from c_dept for json path,include_null_values

select * from openjson('jsonstring')

select * from openjson('[{"dm":"00","ks":"内科"},{"dm":"01","ks":"外科"},{"dm":"02","ks":"儿科"}]')
with (
dm varchar(20) '$.dm',
dm varchar(20) '$.ks')

 

sql2019不能调试debug存储过程,是倒退,不建议升级。