Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Procedure execution sequence

Author  Topic 

sent_sara
Constraint Violating Yak Guru

377 Posts

Posted - 2014-02-17 : 04:19:11
Hi,

Can I know how the procedure will be called inside the trigger,whether first procedure followed by second or parallel it will execute?


CREATE TRIGGER [dbo].[InsertDatFXActualStaging]
ON [dbo].[DatFXActualStaging]--change this table to DatFXActualStaging
for INSERT
AS
BEGIN
SET NOCOUNT ON;

DECLARE @Fiscper INT


select @Fiscper=CONVERT(int,
substring(convert(varchar,MAX(effectivedate),105),7,4)
+
case
when substring(convert(varchar,MAX(effectivedate),105),4,2)='10' then '001'
when substring(convert(varchar,MAX(effectivedate),105),4,2)='11' then '002'
when substring(convert(varchar,MAX(effectivedate),105),4,2)='12' then '003'
when substring(convert(varchar,MAX(effectivedate),105),4,2)='01' then '004'
when substring(convert(varchar,MAX(effectivedate),105),4,2)='02' then '005'
when substring(convert(varchar,MAX(effectivedate),105),4,2)='03' then '006'
when substring(convert(varchar,MAX(effectivedate),105),4,2)='04' then '007'
when substring(convert(varchar,MAX(effectivedate),105),4,2)='05' then '008'
when substring(convert(varchar,MAX(effectivedate),105),4,2)='06' then '009'
when substring(convert(varchar,MAX(effectivedate),105),4,2)='07' then '010'
when substring(convert(varchar,MAX(effectivedate),105),4,2)='08' then '011'
when substring(convert(varchar,MAX(effectivedate),105),4,2)='09' then '012'
end)
from dbo.DatFXActualStaging
where effectivedate=(select MAX(effectivedate) from inserted);

exec [usp_fagflexb_territory_currency] @Fiscper,1,1
exec [usp_fagflexb_overhead_territory_currency] @Fiscper,1,1
SET NOCOUNT OFF;

END

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2014-02-17 : 05:20:47
it will first followed by second.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -