zoukankan      html  css  js  c++  java
  • 跨服务器导入数据SQL语句 jerry

    跨服务器导入数据SQL语句 

     

    跨服务器导入数据SQL语句及其问题解决方案 跨服务器导入数据SQL语句:

    --自定义表名,在导入前创建表 SELECT * INTO TbName FROM OPENROWSET('SQLOLEDB','192.168.0.7';'sa';'damon king',DBName.dbo.TbName)

    --跨服务器查询示例 SELECT * FROM OPENROWSET('SQLOLEDB','192.168.0.7';'sa';damon king',DBName.dbo.TbName) 按F5执行,若未启用'Ad Hoc Distributed Queries'(专案分布式查询),则会提示如下信息:

    SQL Server 阻止了对组件 'Ad Hoc Distributed Queries' 的 STATEMENT'OpenRowset/OpenDatasource' 的访问,因为此组件已作为此服务器安全配置的一部分而被关闭。系统管理员可以通过使用 sp_configure 启用 'Ad Hoc Distributed Queries'。有关启用 'Ad Hoc Distributed Queries' 的详细信息,请参阅 SQL Server 联机丛书中的 "外围应用配置器"。

    此时,可以使用sp_configure来启用'Ad Hoc Distributed Queries' :

    --启用'Ad Hoc Distributed Queries'

    EXEC SP_CONFIGURE 'show advanced options',1 RECONFIGURE EXEC SP_CONFIGURE 'Ad Hoc Distributed Queries',1 RECONFIGURE

    当执行完导入后,最好将'Ad Hoc Distributed Queries' 关闭: --关闭'Ad Hoc Distributed Queries' 

    EXEC SP_CONFIGURE 'Ad Hoc Distributed Queries',0 RECONFIGURE EXEC SP_CONFIGURE 'show advanced options',0 RECONFIGURE

    此时完成了跨服务器导入数据任务!
  • 相关阅读:
    CSS input
    CSS 伪类选择器
    input placeholder 文字颜色修改
    css flex弹性布局学习总结
    jqGrid使用方法
    GridView控件RowDataBound事件的一个实例
    GridView控件RowDataBound事件中获取列字段值的几种途径 !!!
    .net中ckeditor的应用
    博客第一天
    用python实现数学多元数学方程式计算
  • 原文地址:https://www.cnblogs.com/mbailing/p/2847914.html
Copyright © 2011-2022 走看看