SQL 分布式查询、插入递增列示例
时间:2024-01-21 01:49:39
truncate table TestTable
EXEC sp_configure 'show advanced options', 1; -- 开启高级配置
RECONFIGURE
EXEC sp_configure 'Ad Hoc Distributed Queries', 1;--开启分布式查询
RECONFIGURE
set IDENTITY_insert TestTable on --设置 某表允许插入递增量
INSERT INTO TestTable(ID,Date,Info )SELECT a.ID,a.Date,a.Info
FROM OPENROWSET('SQLOLEDB','V';'sa';'123456',
'SELECT * FROM TestDatabase.dbo.TestTable') AS a
set IDENTITY_insert TestTable OFF --设置 不某表允许插入递增量
EXEC sp_configure 'Ad Hoc Distributed Queries', 0;--关闭分布式查询
RECONFIGURE
EXEC sp_configure 'show advanced options', 0;--关闭高级配置
RECONFIGURE
标签:SQL,分布式,递增列
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
pandas数据类型之Series的具体使用
2022-03-30 18:54:46
Python学习之装饰器与类的装饰器详解
2023-11-23 20:04:07
Selenium常见异常解析及解决方案示范
2023-06-27 20:09:48
pygame实现烟雨蒙蒙下彩虹雨
2023-05-07 01:19:36
![](https://img.aspxhome.com/file/2023/8/134878_0s.jpg)
给展示性图片增加提示工具条(黑白效果)
2007-10-20 14:21:00
Oracle7.X 回滚表空间数据文件误删除处理方法
2010-07-28 12:54:00
BootstrapValidator实现注册校验和登录错误提示效果
2024-04-08 10:57:03
![](https://img.aspxhome.com/file/2023/6/136956_0s.png)
SQL查询之字段是逗号分隔开的数组如何查询匹配数据问题
2024-01-21 22:32:08
MySQL定位并优化慢查询sql的详细实例
2024-01-25 20:32:16
![](https://img.aspxhome.com/file/2023/6/112666_0s.png)
Vue中keep-alive组件的深入理解
2023-07-02 17:00:38
![](https://img.aspxhome.com/file/2023/4/139884_0s.gif)
python数据结构算法分析
2022-06-11 02:57:15
![](https://img.aspxhome.com/file/2023/8/72718_0s.png)
js图片随机显示技巧
2007-08-19 20:20:00
vue项目中的数据变化被watch监听并处理
2024-04-27 16:11:53
js读写COOKIE实现记住帐号或密码的代码(js读写COOKIE)
2024-04-18 10:11:12
python机器学习Github已达8.9Kstars模型解释器LIME
2022-06-21 13:38:28
![](https://img.aspxhome.com/file/2023/2/90912_0s.png)
python操作链表的示例代码
2023-08-08 23:55:41
Python 5种常见字符串去除空格操作的方法
2023-12-18 18:52:58
简单谈谈MySQL优化利器-慢查询
2024-01-28 02:30:33
keras.utils.to_categorical和one hot格式解析
2023-10-03 18:27:12
![](https://img.aspxhome.com/file/2023/8/133348_0s.jpg)
让文本框textarea自动适应内容的高度
2008-07-01 14:44:00