It works quicker than #tmp because TABLE-VARIABLE located in-memory and does not require disk I/O.
Microsoft SQL Server is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.SQL Server is available in multiple versions, typically identified by release year, and versions are subdivided into editions to distinguish between product functionality. Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning.
TRUSTED BY
ASKER
if object_id('tempdb..#special_types') is not null
AND tbl.special_code not in ('192','703','A95','705','A955','7054')
drop table #special_types create table #special_types
(
special_type_code varchar(100) collate database_default
)
insert into #special_types select value from dbo.c_split(@special_type_code,',')