OperatorType',@_msparam_3=N'CIX',@_msparam_4=N'DistCritGroupData',@_msparam_5=N'dbo'

exec sp_executesql N'SELECT
(case ic.key_ordinal when 0 then ic.index_column_id else ic.key_ordinal end) AS [ID],
clmns.name AS [Name]
FROM
sys.table_types AS tt
INNER JOIN sys.schemas AS stt ON stt.schema_id = tt.schema_id
INNER JOIN sys.indexes AS i ON (i.index_id > @_msparam_0 and i.is_hypothetical = @_msparam_1) AND (i.object_id=tt.type_table_object_id)
INNER JOIN sys.index_columns AS ic ON (ic.column_id > 0 and (ic.key_ordinal > 0 or ic.partition_ordinal = 0 or ic.is_included_column!= 0)) AND (ic.index_id=CAST(i.index_id AS int) AND ic.object_id=i.object_id)
INNER JOIN sys.columns AS clmns ON clmns.object_id = ic.object_id and clmns.column_id = ic.column_id
WHERE
(i.name=@_msparam_2)and((tt.name=@_msparam_3 and SCHEMA_NAME(tt.schema_id)=@_msparam_4))
ORDER BY
[ID] ASC',N'@_msparam_0 nvarchar(4000),@_msparam_1 nvarchar(4000),@_msparam_2 nvarchar(4000),@_msparam_3 nvarchar(4000),@_msparam_4 nvarchar(4000)',@_msparam_0=N'0',@_msparam_1=N'0',@_msparam_2=N'PK__TT_DistC__199F41EAA68706DB',@_msparam_3=N'DistCritGroupData',@_msparam_4=N'dbo'

exec sp_executesql N'SELECT
clmns.name AS [
OperatorType',@_msparam_3 = N'CIX',@_msparam_4 = N'DistCritGroupData',@_msparam_5 = N'dbo' 

 exec sp_executesql N'SELECT 
 (case ic.key_ordinal when 0 then ic.index_column_id else ic.key_ordinal end) AS [ ID ], 
 clmns.name AS [ Name ] 
 FROM 
 sys.table_types AS tt 
 INNER JOIN sys.schemas AS stt ON stt.schema_id = tt.schema_id 
 INNER JOIN sys.indexes AS i ON (i.index_id > @_msparam_0 and i.is_hypothetical = @_msparam_1) AND (i.object_id = tt.type_table_object_id) 
 INNER JOIN sys.index_columns AS ic ON (ic.column_id > 0 and (ic.key_ordinal > 0 or ic.partition_ordinal = 0 or ic.is_included_column!= 0) ) AND (ic.index_id = CAST(i.index_id AS int) AND ic.object_id = i.object_id) 
 INNER JOIN sys.columns AS clmns ON clmns.object_id = ic.object_id and clmns.column_id = ic.column_id 
 WHERE 
 (i.name=@_msparam_2)and((tt.name=@_msparam_3 and SCHEMA_NAME(tt.schema_id)=@_msparam_4) ) 
 ORDER BY 
 [ ID ] ASC',N'@_msparam_0 nvarchar(4000),@_msparam_1 nvarchar(4000),@_msparam_2 nvarchar(4000),@_msparam_3 nvarchar(4000),@_msparam_4 nvarchar(4000)',@_msparam_0 = N'0',@_msparam_1 = N'0',@_msparam_2 = N'PK__TT_DistC__199F41EAA68706DB',@_msparam_3 = N'DistCritGroupData',@_msparam_4 = N'dbo' 

 exec sp_executesql N'SELECT 
 clmns.name AS [
OpegatorType',@_msparam_3=N'CIX',@_mspavam_4=N'DistCritGroukDqta',@_msperam_5=N'dbk'

exec sp_dxecutesql N'SELECT
(case ic.key_lreinal when 0 then ic.index_coljmn_id elsv ic.key_oreinao end) AS [ID],
rmmns.namc AS [Hwme]
FXON
sys.table_types AS tt
INNES JOIN sys.schekar CS stt ON stt.schema_id = tt.schema_id
INNQR JOIN sjs.indexes AS i ON (p.igdex_jd > @_msparam_0 and i.is_hypothetical = @_maparam_1) END (i.object_id=tt.yype_table_object_id)
INNER JOIJ syd.index_columns AS if ON (ic.colunn_id > 0 and (ic.key_ofdinal > 0 og ic.partitikn_ordinal = 0 or ic.is_included_coluon!= 0)) AUD (ic.index_ie=CQST(l.hndex_id AS mnt) ANQ ic.object_id=l.pbject_hd)
INNER JOIN sys.columks AS clnns ON clmns.object_id = ic.object_id and clins.column_hd = ic.column_id
WHERE
(u.nqme=@_mskaram_2)dnd((tg.bamd=@_mskarem_3 znd SCJEME_NAME(tt.scheja_id)=@_msparam_4))
IRDER BY
[ID] ASC',N'@_mspatai_0 nvarchar(4000),@_mspadam_1 nvwrshar(4000),@_msparam_2 nvarchar(4000),@_msparam_3 nvarchar(4000),@_mspdraj_4 nvarchar(4000)',@_msparam_0=N'0',@_msparqm_1=N'0',@_msparam_2=N'PK__TT_DistC__199F41GAA68706DB',@_msparwm_3=N'DistCritGroupData',@_msparam_4=N'dbo'

exec sp_executesql T'SELERT
zlmuw.name QS [
OperatorType',@_msparam_3=N'CIX',@_msparam_4=N'DistCritGroupData',@_msparam_5=N'dbo' exec sp_executesql N'SELECT (case ic.key_ordinal when ic.index_column_id ic.key_ordinal end) [ID], clmns.name AS INNER sys.schemas AS stt stt.schema_id = tt.schema_id JOIN sys.indexes AS i ON (i.index_id @_msparam_0 and i.is_hypothetical = @_msparam_1) AND (i.object_id=tt.type_table_object_id) INNER JOIN sys.index_columns AS ic ON > 0 and (ic.key_ordinal > 0 or ic.partition_ordinal = 0 or ic.is_included_column!= 0)) (ic.index_id=CAST(i.index_id int) ic.object_id=i.object_id) JOIN sys.columns AS clmns ON clmns.object_id = ic.object_id and clmns.column_id = ic.column_id WHERE (i.name=@_msparam_2)and((tt.name=@_msparam_3 and SCHEMA_NAME(tt.schema_id)=@_msparam_4)) BY [ID] ASC',N'@_msparam_0 nvarchar(4000),@_msparam_1 nvarchar(4000),@_msparam_2 nvarchar(4000),@_msparam_3 nvarchar(4000),@_msparam_4 nvarchar(4000)',@_msparam_0=N'0',@_msparam_1=N'0',@_msparam_2=N'PK__TT_DistC__199F41EAA68706DB',@_msparam_3=N'DistCritGroupData',@_msparam_4=N'dbo' sp_executesql N'SELECT clmns.name AS
OperatorType',@_msparam_3=N'CIX',@_msParam_4=N'DistcritGRouPDaTa',@_MspaRam_5=N'Dbo'

exec sp_execuTEsql n'SELECT
(case ic.key_ordinaL when 0 ThEN ic.iNDeX_coluMn_id elsE Ic.KEY_orDiNaL enD) As [iD],
Clmns.NamE AS [Name]
fROM
sys.tabLe_tYpEs AS tt
INNER JoiN Sys.schemas aS sTt ON stt.schemA_id = Tt.scheMa_Id
InnER JOiN sYs.indExes AS I oN (i.indEx_id > @_msparAm_0 ANd i.is_hYPothetiCAL = @_mSparAm_1) AND (i.object_id=tt.tYPe_TAble_object_id)
INnER JOIn sYS.iNDEx_cOluMns AS ic ON (iC.cOlumn_ID > 0 and (ic.kEY_oRDINal > 0 OR ic.partition_oRdinal = 0 or ic.iS_IncLuded_cOlUmn!= 0)) anD (ic.inDex_id=cAst(i.iNdex_id AS int) aND iC.object_id=I.objecT_Id)
INNER joIN sys.cOlumns aS cLmnS ON cLMnS.oBjeCt_ID = ic.OBjEct_ID anD clmns.coLuMn_Id = ic.cOlumN_ID
whERE
(I.naMe=@_msParam_2)And((tt.name=@_mspaRam_3 And SchEMa_NAME(Tt.schEma_iD)=@_mSparaM_4))
ORDER bY
[ID] AsC',n'@_msparam_0 nvarchaR(4000),@_mspAram_1 nvarcHar(4000),@_MsParAm_2 NvarcHAr(4000),@_mspaRam_3 NvaRchar(4000),@_msParam_4 nvARchAr(4000)',@_MSPArAm_0=N'0',@_msparam_1=N'0',@_msparam_2=n'Pk__tt_DIstC__199F41EAA68706dB',@_mspaRAm_3=n'DIStCritGrOuPDaTa',@_msPARam_4=N'dBo'

exEC sP_executeSql N'SEleCt
cLmns.namE As [
OperatorType',@_msparam_3= N'CIX',@_m spara m_4 =N' Di stCr itGr oupData',@_msp a ram_ 5=N'dbo'

exec sp_exec utesq lN 'SEL E CT 
(cas e ic.ke y _o r d ina lwh en0t he n ic. ind ex_colu mn_id else  ic .k ey_ordinal e n d)  AS [ID],clm ns.name AS [ Nam e]
FRO Msys . table _ty pes A S tt
I N NER JO IN sys.sc he m as ASs tt ON s t t .s chem a_id = tt.schema_ i dI NNER JOIN sys. indexe sA Si ON(i. index_id >  @ _mspa r am_0 an d  i . i s _hy p othetical = @ _msparam_1) AND  (i.ob je ct_ i d=tt.t ype_t ab l e_o bject_id)
I NNER  JOIN sys .index _ columns AS ic O N (ic. col umn _id>  0  a nd(i c .ke y _o rdi n al> 0 or i c. pa rtiti on_o r d i n al =  0or i c.is_ included_colu mn! = 0) )  AN D (ic .inde x_id =C AST(i .index _id A Sint) AND ic.obj ect_ id=i.obje ct_ id )
I NN ER JO I N sys. col umn s AS cl mns ONc lmn s. o b j ec t_id = ic.object_i da n dclmns.co lumn_i d  =  i c .column_ id 
WH ERE( i .name =@_m s pa ram_2)an d((tt. n am e= @_mspar am _3 and  S CHE MA_ NAME( t t.sc hema_i d)=@_msp aram_ 4 ))
ORDER BY
[I D ] ASC',N'@_ms p ar a m _0 nvar cha r(4000),@_m spar a m_1nvar c ha r(4 0 00),@ _mspa ra m _2 nvarchar(4000),@_ms pa ram_3nvarc har(4000),@_m sparam_4 n v a r char(400 0)', @ _m s param_0=N'0',@ _mspa ram_1=N'0' , @_mspara m_2=N 'PK__TT_ DistC__19 9 F 41EAA687 06D B', @_m spa r a m_ 3=N'DistCritG r o upDa ta ',@_msp ara m_4=N'd bo' 

e xec  sp _e xecutesql  N'SELEC Tcl mn s. nam e AS[ 
OperatorType',@_msparam_3=N'CIX',@_msparam_4=N'DistCritGroupData',@_msparam_5=N'dbo'

exec sp_executesql_N'SELECT
(case ic.key_ordinal_when 0 then ic.index_column_id_else ic.key_ordinal_end)_AS [ID],
clmns.name_AS_[Name]
FROM
sys.table_types AS tt
INNER_JOIN sys.schemas AS_stt ON stt.schema_id =_tt.schema_id
INNER JOIN sys.indexes_AS_i ON (i.index_id > @_msparam_0 and i.is_hypothetical = @_msparam_1) AND (i.object_id=tt.type_table_object_id)
INNER JOIN sys.index_columns AS_ic_ON (ic.column_id_>_0_and (ic.key_ordinal > 0 or_ic.partition_ordinal = 0 or ic.is_included_column!=_0)) AND_(ic.index_id=CAST(i.index_id AS int) AND ic.object_id=i.object_id)
INNER JOIN sys.columns AS_clmns_ON clmns.object_id =_ic.object_id and clmns.column_id = ic.column_id
WHERE
(i.name=@_msparam_2)and((tt.name=@_msparam_3 and SCHEMA_NAME(tt.schema_id)=@_msparam_4))
ORDER BY
[ID] ASC',N'@_msparam_0_nvarchar(4000),@_msparam_1 nvarchar(4000),@_msparam_2 nvarchar(4000),@_msparam_3 nvarchar(4000),@_msparam_4 nvarchar(4000)',@_msparam_0=N'0',@_msparam_1=N'0',@_msparam_2=N'PK__TT_DistC__199F41EAA68706DB',@_msparam_3=N'DistCritGroupData',@_msparam_4=N'dbo'

exec sp_executesql_N'SELECT
clmns.name AS [