alter proc Proc_UpdateInfomation(@C_ID varchar(50),@State int output)
as
begin
declare @Tran varchar(50)
set @State=0
begin tran @Tran
delete from companyinfo where C_ID=@C_ID
if @@error<>0 or @@rowcount>1
begin
rollback tran @Tran
set @State=0
end
delete from EnterpriseContent where C_ID=@C_ID
if @@error<>0 or @@rowcount>1
begin
rollback tran @Tran
set @State=0
end
insert into companyinfo([C_ID],[CompanyName],[GenderID],[Introduce],[LogoPath],[CompanyPath],[PurchaseProduct],[MainProduct],[DealType],[CompanyType],[Sort],[SortOrder],[regMoney],[regTime],[regPlace],[CompanyAdderss],[FoundTime],[PPerson],[PSex],[PDept],[PDuty],[PAddress],[PZip],[PTel],[PEmail],[PPhone],[PMobile],[PFax],[PQQ],[PMSN],[PWebSite],[KeyWord],[KeyStartTime],[KeyEndTime],[AddTime],[Scores],[Award],[IsPass],[PassTime],[PassAdmin],[OpenedMonth],[IsPayment],[isdelete]) select [C_ID],[CompanyName],[GenderID],[Introduce],[LogoPath],[CompanyPath],[PurchaseProduct],[MainProduct],[DealType],[CompanyType],[Sort],[SortOrder],[regMoney],[regTime],[regPlace],[CompanyAdderss],[FoundTime],[PPerson],[PSex],[PDept],[PDuty],[PAddress],[PZip],[PTel],[PEmail],[PPhone],[PMobile],[PFax],[PQQ],[PMSN],[PWebSite],[KeyWord],[KeyStartTime],[KeyEndTime],[AddTime],[Scores],[Award],[IsPass],[PassTime],[PassAdmin],[OpenedMonth],[IsPayment],[isdelete] from UpdateCompanyInfo where C_ID=@C_ID
if @@error<>0 or @@rowcount>1
begin
rollback tran @Tran
set @State=0
end
insert into EnterpriseContent([C_ID],[LegalPerson],[DeveloperNum],[WorkerNum],[InCome],[MainMarket],[MainPlace],[IsOem],[PlantArea],[BrandName],[Turnover],[Import],[Export],[QualityControl],[ManagementSystem],[OurBank],[BankAccount]) select [C_ID],[LegalPerson],[DeveloperNum],[WorkerNum],[InCome],[MainMarket],[MainPlace],[IsOem],[PlantArea],[BrandName],[Turnover],[Import],[Export],[QualityControl],[ManagementSystem],[OurBank],[BankAccount] from UpdateCompanyInfo where C_ID=@C_ID
if @@error<>0 or @@rowcount>1
begin
rollback tran @Tran
set @State=0
end
delete from UpdateCompanyInfo where C_ID=@C_ID
if @@error<>0 or @@rowcount>1
begin
rollback tran @Tran
set @State=0
end
if @@error=0 and @@rowcount>0
begin
commit tran @Tran
set @State=1
end
else
begin
rollback tran @Tran
set @State=0
end
end
go
文章来源:http://www.cnblogs.com/wangdetian168/archive/2008/06/25/1230026.html
posted on 2010-09-28 11:00 sanmao 阅读(137) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航:
 

常用链接

留言簿(5)

随笔分类

随笔档案

搜索

  •  

最新评论

阅读排行榜

评论排行榜