heimirror
alter TRIGGER InsertEnterprise
   
ON T_Enterprise
  instead 
of INSERT 
AS 
BEGIN
    
SET NOCOUNT ON;
    
SET QUOTED_IDENTIFIER ON;
    
declare @TempId int
    
insert into fieldweb.dbo.enterpriseinfo(companyname,ServicesType,Location
    ,E_Code,EnterpriseNO)
    
select companyname,industryid,address,postcode,enterprisecode from inserted
    
select  @TempId=@@identity

    
INSERT INTO [CRM].[dbo].[T_Enterprise]
           (
[CompanyName]
           ,
[EnterpriseCode]
           ,
[WebSiteId]
           ,
[IndustryId]
           ,
[IndustryName]
           ,
[NatrueId]
           ,
[NatrueName]
           ,
[Address]
           ,
[PostCode]
           ,
[WebUrl]
           ,
[AddTime]
           ,
[Operator])
           
select
            
[CompanyName]
           ,
[EnterpriseCode]
           ,
[WebSiteId]
           ,
[IndustryId]
           ,
[IndustryName]
           ,
[NatrueId]
           ,
[NatrueName]
           ,
[Address]
           ,
[PostCode]
           ,
[WebUrl]
           ,
[AddTime]
           ,
[Operator]
            
from inserted
    
update t_enterprise set websiteid=@TempId where id=@@identity
    
END
GO

分类:

技术点:

相关文章:

  • 2022-03-14
  • 2022-03-14
  • 2022-01-20
  • 2022-03-14
  • 2021-11-29
  • 2021-10-22
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-12
  • 2022-12-23
  • 2022-12-23
  • 2022-03-14
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案