set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
CREATE PROCEDURE [dbo].[spCompanyList]
(
@project bit,
@employeeID smallint,
@custID smallint
)
AS
select companyID,company,phone,cellphone,email,web
from tblCompany
where active=1
and project=@project
and custID=@custID
and employeeID = ( case when project = 1 and private = 1 Then @employeeID ELSE employeeID END )
order by company |