IF EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[mps_g_flowwork_auto]') AND type = 'P')
DROP PROCEDURE [dbo].[mps_g_flowwork_auto]
GO
create procedure [dbo].[mps_g_flowwork_auto](
@cmpid int ,
@wrkid int)
as
begin
set nocount on

begin
select wrk_id,wrk_auto2_interval wrk_auto_interval,
wrk_auto2_unit wrk_auto_unit,
wrk_auto2_starttime wrk_auto_starttime,
wrk_auto2_webservice  wrk_auto_webservice
from mps_flowwork with(nolock) where wrk_id=@wrkid

select * from mps_extsqljs with(nolock) where cd_objid=@wrkid and cd_name='wrk.wrkauto'
end
set nocount off
end