troubleshooting Question

Return Bit field based on code existance in Two Tables

Avatar of Easwaran Paramasivam
Easwaran ParamasivamFlag for India asked on
Microsoft SQL Server 2005Microsoft SQL Server 2008
4 Comments1 Solution374 ViewsLast Modified:
I've one table TableA.

TableA
======


I've one View ViewA.
Id Code Description
-- ------   ---------------
1  001    One
2  002    Two
3  003    Three
.................


ViewA
=====

Code
-----
002
.........

I would like to get output in such a way that I need to check each and every code from table to View and have a Bit flag(1 if exists 0 otherwise) if the TableA code exists in ViewA.

Expected output:


Id Code Description  IsExistsInView
-- ------   -------------  ------------------
1  001    One              0
2  002    Two              1
3  003    Three           0
.................


Please help. Thanks.
ASKER CERTIFIED SOLUTION
simonet

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 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 1 Answer 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