碼農往事
          我的代碼為什么這么丑?一定是因為我長的不好看
          posts - 29,comments - 86,trackbacks - 0

          --啟用Ad Hoc Distributed Queries 
          --
          (使用以下兩句代碼的原因:下面的sql中,其中有幾個從其他數據庫導入數據的語句,所以必須得先啟用Ad Hoc Distributed Queries,使用結束后,最好關閉它 )
          exec sp_configure 'show advanced options',1
          reconfigure
          exec sp_configure 'Ad Hoc Distributed Queries',1
          reconfigure

           

          GO
          delete from syscode
          insert into syscode 
          select type,code,name,note,value1,value2 FROM opendatasource('SQLOLEDB','Data Source=192.168.1.101;User ID=sa; Password=***').[DATABASE_NAME].dbo.syscode


          --使用完成后,關閉Ad Hoc Distributed Queries:
          exec sp_configure 'Ad Hoc Distributed Queries',0
          reconfigure
          exec sp_configure 'show advanced options',0
          reconfigure
          posted on 2013-02-03 11:27 Jimi 閱讀(2773) 評論(0)  編輯  收藏

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


          網站導航:
           
          主站蜘蛛池模板: 阿克苏市| 都匀市| 盱眙县| 乡城县| 临湘市| 泌阳县| 阿坝县| 哈密市| 寿宁县| 澄城县| 岢岚县| 赣榆县| 海丰县| 垦利县| 鹤壁市| 靖江市| 佳木斯市| 上饶县| 新河县| 邛崃市| 安顺市| 资溪县| 桃园市| 黑水县| 临海市| 淳化县| 将乐县| 晋州市| 菏泽市| 右玉县| 托克逊县| 上高县| 纳雍县| 永清县| 闸北区| 义马市| 江津市| 东兴市| 东乡族自治县| 龙山县| 彭山县|