垮库只能读操作,写操作需要设置权限. USE [jdddb] GO /****** Object: StoredProcedure [dbo].[proc_LYOrderCancel] Script Date: 02/07/2017 11:18:55 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO -- ============================================= -- Author: 赵伟 -- C
在同样是SQLserver数据库跨库访问时,只需要以下方法 declare @rowcount int set @rowcount =(select COUNT(*) from sys.servers where name = 'ITSV2') begin exec sp_addlinkedserver 'ITSV2', ' ', 'SQLOLEDB', '192.168.0.222,8989' --IP,端口号 end exec sp_addlinkedsrvlogin 'ITSV2','fa
方式一: 语句 SELECT * FROM 数据库A.dbo.表A a, 数据库B.dbo.表B b WHERE a.field=b.field "DBO"可以省略 如 SELECT * FROM 数据库A..表A a, 数据库B..表B b WHERE a.field=b.field 方式二(在一个数据库挂上另一个数据库的外链): SqlServer数据库: --这句是映射一个远程数据库 EXEC sp_addlinkedserver '远程数据库的IP或主机名',N'SQL Ser
一:跨库查询 Openrowset/opendatasource() is an ad-hoc method to access remote server's data. So, if you only need to access the remote server's data once and you do not to persist the connection info, this would be the right choice. Otherwise, you should c