set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
create PROCEDURE [dbo].[STPIsCheckOutExist] 
     @SerialNo  bigint,
     @CheckDate nvarchar(1000)='' ,
     @BankAccountCode  Int 
    
AS
if exists(SELECT     CheckOUTTBL.FK_DocSysCode
FROM         CheckInTBL CROSS JOIN
                      CheckOUTTBL
WHERE     (CheckOUTTBL.SerialNo = @SerialNo) AND (CheckOUTTBL.CheckDate = @CheckDate) AND (CheckOUTTBL.FK_BankAccount = @BankAccountCode)) return 1 else return 0
