IF EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[mps_login_userinfo]') AND type = 'P')
DROP PROCEDURE [dbo].[mps_login_userinfo]
GO
CREATE proc [dbo].[mps_login_userinfo]
@cuid int
as begin
    set nocount on 
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED 
--
    declare @cutype int,@cuuse int 
    select @cuuse = cu_use from mps_employee where cu_id = @cuid 
select @cutype = cu_type from mps_login where cu_id = @cuid
--if (@cutype=0 or @cutype=1) and @cuuse = 0
if @cuuse = 0
begin
    SELECT *
     ,@cuid as cu_loginid
 ,1 as flag
FROM mps_login
where cu_id=@cuid
end else
begin
    select 0 as flag
end
set nocount off
end