当前位置: 移动技术网 > IT编程>数据库>MSSQL > SQL 分布式查询、插入递增列示例

SQL 分布式查询、插入递增列示例

2017年12月12日  | 移动技术网IT编程  | 我要评论

西村香那,会声会影安装序列号,野宫里美ed2k

复制代码 代码如下:

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

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网