$1 PROCEDURE [dbo].[STOK_BARKOD]
@magaza_no_liste StringList READONLY
AS
SELECT
mgz_isim as MağazaIsim,
sto_kod as StokKodu,
sto_isim as StokIsim,
bar_barkodu as Barkod,
bar_birim_fiyat1 as Fiyat1,
bar_birim_fiyat2 as Fiyat2,
bar_birim_fiyat3 as Fiyat3,
bar_birim_fiyat4 as Fiyat4,
bar_birim_fiyat5 as Fiyat5
FROM 
STOKLAR WITH(NOLOCK)
LEFT OUTER JOIN STOK_BARKOD_TANIMLARI WITH(NOLOCK) ON bar_stokkodu=sto_kod
LEFT OUTER JOIN MAGAZA_TANIMLARI WITH(NOLOCK) ON mgz_kod=bar_depono
WHERE (((select COUNT(Item) from @magaza_no_liste)>0 AND bar_depono IN (select Item from @magaza_no_liste)) OR (select Count(Item) from @magaza_no_liste)<=0)