troubleshooting Question

How do I create a temporary table that will omit specific values

Avatar of RUA Volunteer2?
RUA Volunteer2?Flag for United States of America asked on
Microsoft SQL Server
4 Comments2 Solutions15 ViewsLast Modified:
I think the format is something like this:
if object_id('tempdb..#special_types') is not null 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,',')

The Special Codes that need to be omitted are. Where would this go.
" tbl.special_code not in ('192','703','A95','705','A955','7054') "

I am assuming this table would then need to be joined in the FROM statement to pull those records back in. 
David Todd
Senior Database Administrator

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 2 Answers and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros