Hi am using a scalar function to compute some values and add it as a column while retriving the table.The query i was using is
Select * ,dbo.funcnme(@userid,itemid) as newvalue from items
now i have a scenario in which i have to call a function based on a items value but i cant get it right.the query i tried is
select *,
Case when items.Value=4
then dbo.funcnme(@userid,itemid) as newvalue
else dbo.newfuncnme(@userid,itemid)
as newvalue from items
it shows
Incorrect syntax near the keyword 'as'.
Whats wrong here.How can i do it please help.