
/****** Object:  StoredProcedure [dbo].[P_GetZBDH]    Script Date: 05/21/2018 16:47:31 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[P_GetZBDH]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[P_GetZBDH]
GO


/****** Object:  StoredProcedure [dbo].[P_GetZBDH]    Script Date: 05/21/2018 16:47:31 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO



CREATE PROCEDURE [dbo].[P_GetZBDH] 
AS
BEGIN

	SET NOCOUNT ON;
	declare @zbdh varchar(50)
	declare @zbid int
	select Top 1 @zbdh=F_ZBDH,@zbid=F_ZBID from T_Call_ZBDH order by F_CallinTime,F_ZBID
	
	update T_Call_ZBDH set F_CallinTime=GETDATE() where F_ZBID=@zbid

    
	select @zbdh
END


GO


