Jag har en sp som är lite beroende av vad som kommer in.
Det är just where i min where som jag skulle vilja lägga en if sats då jag left joinar in en massa tabeller, men det är inte alltid jag vill plocka ut från dem.
ex:
Select customerName from customer_contact cc
left join System_reference SRP on SRP.OfficeID = CC.OfficeID
left join System_reference SRC on SRC.CustomerID = CC.CustomerID
WHERE
SRP.CustomerType = @Type1
OR
SRC.CustomerType = @Type2
Ibland så får jag in text på min @Type1 och ibland på min @Type2, men hur skall jag göra för att kolla om dem innehåller något, om de inte innehåller något så vill jag ju inte använda mig av dem
hade funderingar på:
if @Type1 <>''
SRP.CustomerType = @Type1
end
men det fungerar inte.