set ANSI_NULLS ON set QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dbo].[STPListVisitors] @SecurityLevel int AS SELECT FunCodeComplete_1.AccountSysCode, FunCodeComplete_1.Title FROM dbo.FunCodeComplete(@SecurityLevel) AS FunCodeComplete_1 INNER JOIN PersonTbl ON FunCodeComplete_1.AccountSysCode = PersonTbl.FK_AccountSysCode WHERE PersonTbl.VisitorPerActiveStat <> 0 or VisitorGoodActiveStat<>0