我们的客户安装 CU25 后,存储过程 sp_pkeys 出现问题。如果主键有多个列,它现在可能会返回错误的顺序。
可以在代码本身中找到它。这是 2017 款 CU25 变体:
create procedure sys.sp_pkeys
(
@table_name sysname,
@table_owner sysname = null,
@table_qualifier sysname = null
)
as
declare @table_id int
-- quotename() returns up to 258 chars
declare @full_table_name nvarchar(517) -- 258 + 1 + 258
if @table_qualifier is not null
begin
if db_name() <> @table_qualifier
begin -- If qualifier doesn't match current database
raiserror (15250, -1,-1)
return
end
end
if @table_owner is null
begin -- If unqualified table name
select …Run Code Online (Sandbox Code Playgroud)