惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Simon Willison's Weblog
Simon Willison's Weblog
Google DeepMind News
Google DeepMind News
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
P
Proofpoint News Feed
Recent Announcements
Recent Announcements
MongoDB | Blog
MongoDB | Blog
U
Unit 42
云风的 BLOG
云风的 BLOG
Recorded Future
Recorded Future
G
Google Developers Blog
I
InfoQ
Blog — PlanetScale
Blog — PlanetScale
A
About on SuperTechFans
Jina AI
Jina AI
量子位
宝玉的分享
宝玉的分享
The Cloudflare Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 聂微东
Last Week in AI
Last Week in AI
WordPress大学
WordPress大学
美团技术团队
The Hacker News
The Hacker News
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
D
Darknet – Hacking Tools, Hacker News & Cyber Security
T
Tailwind CSS Blog
博客园 - 司徒正美
博客园 - 叶小钗
Hugging Face - Blog
Hugging Face - Blog
P
Palo Alto Networks Blog
博客园_首页
阮一峰的网络日志
阮一峰的网络日志
博客园 - 【当耐特】
Spread Privacy
Spread Privacy
The GitHub Blog
The GitHub Blog
Y
Y Combinator Blog
Vercel News
Vercel News
Martin Fowler
Martin Fowler
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Forbes - Security
Forbes - Security
Attack and Defense Labs
Attack and Defense Labs
Google DeepMind News
Google DeepMind News
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Microsoft Azure Blog
Microsoft Azure Blog
P
Privacy International News Feed
G
GRAHAM CLULEY
The Last Watchdog
The Last Watchdog
C
Cyber Attacks, Cyber Crime and Cyber Security
AI
AI
V2EX - 技术
V2EX - 技术

博客园 - 蝗虫的大腿

IOS UITest 初始化 ViewController wp8.1 sdk preview 预览版 windows phone 网络开发三部曲(一)各种包的各种抓法 Windows phone UI虚拟化和数据虚拟化(二) Windows phone UI虚拟化和数据虚拟化(一) LongListSelector 控件 在 wp7 和wp8中的不同之处 wp8 longlistselector 动态加载datatemplate windows phone 设计时 数据源 xna 触控操作 备忘 windows phone 在代码中生成ApplicationBar WP8多分辨率解决方案 wp8 模拟器启动失败的解决方法。 Xap 包装失败。未将对象引用设置到对象的实例。 解决办法 wp7 中Panorama控件 title 字体大小 样式的设置 jquery UI dialog 和 asp.net 控件 出错 失效 - 蝗虫的大腿 在sql server 中执行带参数的存储过程及计算运行时间 对于 抽象类 接口 的理解 http错误列表 常用的js正则表达式 - 蝗虫的大腿 - 博客园
不同服务器数据库之间的数据操作
蝗虫的大腿 · 2011-10-19 · via 博客园 - 蝗虫的大腿

不同服务器数据库之间的数据操作--创建链接服务器
exec sp_addlinkedserver 'ITSV' , '' , 'SQLOLEDB' , '远程服务器名或ip地址'
exec sp_addlinkedsrvlogin 'ITSV' , 'false' , null , '用户名' , '密码' --查询示例
select * from ITSV.数据库名.dbo.表名 --导入示例
select * intofrom ITSV.数据库名.dbo.表名 --以后不再使用时删除链接服务器
exec sp_dropserver 'ITSV' , 'droplogins' --连接远程/局域网数据(openrowset/openquery/opendatasource)
--
1、openrowset

--查询示例
select * from openrowset('SQLOLEDB' , 'sql服务器名' ; '用户名' ; '密码' , 数据库名.dbo.表名) --生成本地表
select * intofrom openrowset('SQLOLEDB' , 'sql服务器名' ; '用户名' ; '密码' , 数据库名.dbo.表名) --把本地表导入远程表
insert openrowset( 'SQLOLEDB' , 'sql服务器名' ; '用户名' ; '密码' , 数据库名.dbo.表名)
select *from 本地表 --更新本地表
update b
set b.列A=a.列A
from openrowset('SQLOLEDB' , 'sql服务器名' ; '用户名' ; '密码' , 数据库名.dbo.表名) as a inner join 本地表 b
on a.column1 = b.column1 --openquery用法需要创建一个连接

--首先创建一个连接创建链接服务器
exec sp_addlinkedserver 'ITSV' , '' , 'SQLOLEDB' , '远程服务器名或ip地址'
--查询
select *
FROM openquery(ITSV , 'SELECT * FROM 数据库.dbo.表名')
--把本地表导入远程表
insert openquery(ITSV , 'SELECT * FROM 数据库.dbo.表名')
select * from 本地表
--更新本地表
update b
set b.列B=a.列B
FROM openquery(ITSV , 'SELECT * FROM 数据库.dbo.表名') as a
inner join 本地表 b on a.列A=b.列A --3、opendatasource/openrowset
SELECT *
FROM opendatasource('SQLOLEDB' , 'Data Source=ip/ServerName ; User ID=登陆名 ; Password=密码').test.dbo.roy_ta
--把本地表导入远程表
insert opendatasource('SQLOLEDB' , 'Data Source=ip/ServerName ; User ID=登陆名 ; Password=密码').数据库.dbo.表名
select * from 本地表

蝗虫的大腿--windows phone 平台的坚定支持者!