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

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


          網站導航:
           

          常用鏈接

          留言簿(5)

          隨筆分類

          隨筆檔案

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 姚安县| 冷水江市| 宜宾县| 德清县| 九龙坡区| 侯马市| 怀安县| 镇巴县| 上高县| 安义县| 腾冲县| 封丘县| 大化| 泰顺县| 邻水| 平江县| 丁青县| 汉沽区| 鲁山县| 府谷县| 永康市| 文化| 荔波县| 永登县| 武宣县| 曲水县| 纳雍县| 昭通市| 西华县| 济南市| 徐州市| 苍山县| 文水县| 榆林市| 和林格尔县| 治多县| 上杭县| 沙河市| 平山县| 富平县| 吕梁市|