• Sql Server 简单查询 异步服务器更新语句


    //结构:select 子句 [into 子句] from 子句  [where 子句] [group by 子句]  [having 子句] [order by 子句]

    select  dept_code,count(*) from oh_corp_info
    where create_date>'2006-01-01'
    group by dept_code having count(dept_code)>1  order by dept_code

    //查询前百分之N的数据

    select  top 10 percent  *  from oh_corp_info

    //查询语句between用法

    select * from oh_corp_info where create_date between '2012-01-02' and '2012-03-01'

    //异步服务器获取数据并且插入新表

    insert into dbo.assess_company_project_v(a,b,c)
    select a,b,c  from opendatasource ('SQLOLEDB','Data Source=IP地址(例192.168.5.117);User ID=服务器;Password=123456;').newcq.dbo.assess_company_project_v

    //打开异步服务器连接

    [sql] view plaincopy
    01.exec sp_configure 'show advanced options',1 
    02.reconfigure 
    03.exec sp_configure 'Ad Hoc Distributed Queries',1 
    04.reconfigure

    //使用完成后,关闭Ad Hoc Distributed Queries:

    [sql] view plaincopy
    01.exec sp_configure 'Ad Hoc Distributed Queries',0 
    02.reconfigure 
    03.exec sp_configure 'show advanced options',0 
    04.reconfigure

    生活不是用眼泪博得同情 而是用汗水赢得掌声
  • 相关阅读:
    菜根谭#317
    菜根谭#316
    菜根谭#315
    菜根谭#314
    菜根谭#313
    菜根谭#312
    菜根谭#311
    菜根谭#310
    菜根谭#309
    Matlab xpC启动盘
  • 原文地址:https://www.cnblogs.com/tutuyforever/p/3200118.html
Copyright © 2020-2023  润新知