troubleshooting Question

sql NOT IN

Avatar of aneilg
aneilgFlag for United Kingdom of Great Britain and Northern Ireland asked on
SQL
2 Comments1 Solution271 ViewsLast Modified:
i have the following query.
my mappings table has 10 rows.
my execution log has 8 rows.

what i want to do is display users that are in the mappings but not in execution


SELECT DISTINCT


      b.Prac_Code,
      b.Windows_Login
      
FROM


      ReportServer.dbo.ExecutionLogStorage el with (nolock)
            left outer JOIN [Dashboards].UrgentCare.tbl_User_Mappings b  
                  ON el.UserName collate SQL_Latin1_General_CP1_CI_AS = b.Windows_Login

            and
            
            el.UserName NOT IN
            (SELECT el.UserName collate SQL_Latin1_General_CP1_CI_AS el
                  FROM [Dashboards].UrgentCare.tbl_User_Mappings b)
ASKER CERTIFIED SOLUTION
TempDBA

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

Join our community to see this answer!
Unlock 1 Answer and 2 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 1 Answer and 2 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