IF EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[mps_insert_label]') AND type = 'P')
DROP PROCEDURE [dbo].[mps_insert_label]
GO
CREATE procedure [dbo].[mps_insert_label] 
@cmpid int ,
@lbtype varchar(10),
@lbctgid int
as
begin
set nocount on
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
insert into mps_label_config(lbc_cmpid,lbc_type,lbc_ctgid)  values(@cmpid,@lbtype,@lbctgid) 
select top 1 * from mps_label_config where lbc_cmpid=@cmpid and lbc_type=@lbtype and lbc_ctgid=@lbctgid order by lbc_id desc 
set nocount off
end