Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create View help help help

Status
Not open for further replies.

deva1

Programmer
Oct 28, 2002
27
US
Hi all,
Please help me to find out what am I doing worng.
I have 2 tables

testvw1 ===> empid 4,0
empname 10
empdesc 10
testvw2 ===> empid 4,0
empage 4,0
message 10

I am trying to create a view based on these 2 tables.My create view statement is

create view testview as
select a.empid,
a.empname,
test=case when a.empdesc = NULL then b.message else a.empdesc end
from
testvw1 a inner join testvw2 b on a.empid = b.empid.

But when display records using Testveiw, it always pick test from empdesc.

This is on SQL server 2000

Your help is apprecited.

Deva

 
test=case when a.empdesc IS NULL then b.message else a.empdesc end --James
 
Thanks alot James.It worked very well
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top