You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implemented sys.all_columns, sys.data_spaces, the six sys.tables table-flavor flags (is_memory_optimized / is_filetable / is_external / is_node / is_edge / ledger_type, accepted-but-constant since none of those table kinds are modeled), and a QUOTENAME fidelity fix.
create table t (id int not null primary key, payload xml null, note nvarchar(50) null);
117
+
create index ix_note on t (note);
118
+
""");
119
+
120
+
usingvarreader=sim.ExecuteReader("""
121
+
select
122
+
tbl.name,
123
+
cast(case idx.index_id when 1 then 1 else 0 end as int) as HasClusteredIndex,
124
+
cast(case idx.index_id when 1 then case when (idx.is_primary_key + 2 * idx.is_unique_constraint = 1) then 1 else 0 end else 0 end as int) as HasPrimaryClusteredIndex,
125
+
cast(isnull((select top 1 1 from sys.indexes ind where ind.object_id = tbl.object_id and ind.type > 1 and ind.is_hypothetical = 0), 0) as int) as HasNonClusteredIndex,
126
+
cast(isnull((select top 1 1 from sys.all_columns clmns join sys.types usrt on usrt.user_type_id = clmns.user_type_id where clmns.object_id = tbl.object_id and usrt.name = N'xml'), 0) as int) as HasXmlData,
127
+
cast(isnull((select distinct 1 from sys.all_columns where object_id = tbl.object_id and is_sparse = 1), 0) as int) as HasSparse
128
+
from sys.tables tbl
129
+
inner join sys.indexes idx on idx.object_id = tbl.object_id and idx.index_id < 2
130
+
where tbl.object_id = object_id('t')
131
+
and (cast(case
132
+
when tbl.is_ms_shipped = 1 then 1
133
+
when exists (select 1 from sys.extended_properties
134
+
where major_id = tbl.object_id and minor_id = 0 and class = 1
135
+
and name = N'microsoft_database_tools_support') then 1
136
+
else 0 end as bit) = 0
137
+
and tbl.is_filetable = 0 and tbl.temporal_type = 0 and cast(tbl.is_node as bit) = 0)
0 commit comments