declare @PassedCategory char(1) set @PassedCategory = 'L' declare @CategoryPrice smallmoney select @CategoryPrice = Price from PriceInfo where CreditCategory = @PassedCategory select 'CT' as State, @CategoryPrice as Price, CreditType, county, registry, city, address, def1FName, Def1LName from CTCredit..CreditInfo where CredID in (select CredID from CartDetail inner Join CartContent on CartDetail.CartContentID = CartContent.CartContentID and CartContent.State = 'CT' and CartContent.CreditCategory = @PassedCategory )And I also want to have field list to be a variable. Will try select @FieldList in a sec
select @CategoryPrice = Price from PriceInfo where CreditCategory = @PassedCategory>
>>select 'CT' as State, @CategoryPrice as Price, CreditType, county, >>registry, city, address, def1FName, Def1LName >>from CTCredit..CreditInfo where CredID in >>(select CredID from CartDetail >>inner Join CartContent on >>CartDetail.CartContentID = CartContent.CartContentID >>and CartContent.State = 'CT' and CartContent.CreditCategory = @PassedCategory )>>