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 閱讀(143) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           

          常用鏈接

          留言簿(5)

          隨筆分類

          隨筆檔案

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 三门县| 佛教| 油尖旺区| 开化县| 乌兰县| 贵阳市| 双辽市| 津市市| 射洪县| 枝江市| 剑阁县| 儋州市| 黄石市| 襄樊市| 金坛市| 枣庄市| 正阳县| 怀仁县| 洛扎县| 隆德县| 绥江县| 明溪县| 当阳市| 铜山县| 黄陵县| 灌云县| 东乡族自治县| 石林| 栖霞市| 潼南县| 成安县| 镇平县| 扎赉特旗| 堆龙德庆县| 海门市| 柳江县| 奉节县| 普安县| 开平市| 永顺县| 洪江市|