linked-server

MySQL trigger to update SQL Server table

北城以北 提交于 2019-12-13 17:16:18
问题 Is it possible to update a table in SQL Server using a trigger in MySQL. The scenario is like this. When a table is updated in MySQL, a corresponding update is to be done in SQL Server for the purpose of syncing certain fields. I understand that the reverse is possible using a linked server in SQL Server. 回答1: You can write a UDF function that would update data in the SQL Server. Then call this UDF from the trigger. 回答2: Here's some information which may be of help regarding linking SQL

Fully qualified table names with SP_ExecuteSql to access remote server

倖福魔咒の 提交于 2019-12-13 03:32:37
问题 Trying to update a table on a linked server (SQL 2000/2005) but my server name will not be known ahead of time. I'm trying this: DECLARE @Sql NVARCHAR(4000) DECLARE @ParamDef NVARCHAR(4000) DECLARE @SERVER_NAME VARCHAR(35) SET @Sql = 'UPDATE @server_name_param.dba_sandbox.dbo.SomeTable SET SomeCol=''data''' SET @ParamDef = N'@server_name_param VARCHAR(35)' print @Sql exec sp_executesql @Sql, @ParamDef, @server_name_param=@SERVER_NAME Which returns this: UPDATE @server_name_param.dba_sandbox

Error trying to Select x rows from DB2 (V4R5M0) via sql server linked server using OPENQUERY

爷,独闯天下 提交于 2019-12-12 18:06:18
问题 I have a Linked Server from SQL Server 2008 R2, to a DB2 Database (V4R5M0) using OLE DB provider "IBMDA400" Linked Server Detials EXEC master.dbo.sp_addlinkedserver @server = N'JTEST', @srvproduct=N'IBM OLE DB Provider for DB2', @provider=N'IBMDA400', @datasrc=N'TestName' This works fine: SELECT * FROM OPENQUERY(JTEST, 'Select * from QSYS2.SYSCOLUMNS') But the following statement produces an error: SELECT * FROM OPENQUERY(JTEST, 'Select * from QSYS2.SYSCOLUMNS FETCH FIRST 10 ROWS ONLY') Error

How to get “Lookup” functionality in Access when linking to a SQL table?

牧云@^-^@ 提交于 2019-12-12 17:08:18
问题 This question was migrated from Database Administrators Stack Exchange because it can be answered on Stack Overflow. Migrated 6 years ago . I am building a SQL database which will have an Access 2010 front-end. I would like some of the fields to be lookups in Access (ie the user clicks on the field in Access and a drop down populates). It is fairly straightforward to make a field a lookup for another table in Access but I can't seem to know how to do it in SQL and then propagate the changes.

What is the best way to cache a table from a (SQL) linked server view?

☆樱花仙子☆ 提交于 2019-12-12 15:13:32
问题 I have a view that retrieves data from/through a linked server, thus when calling the linked table through the view I will use select * from linkerserver.linkedtable . My query works and I get a table of info back. I am however concerned about speed and contention when using a linked server especially if there are multiple users accessing/calling a sp (Stored Procedure) that makes use of the Linked Server View. I am unsure as to how I could solve this problem or even if it is a problem? (Will

Is it possible to create a temp table on a linked server?

浪子不回头ぞ 提交于 2019-12-12 10:36:35
问题 I'm doing some fairly complex queries against a remote linked server, and it would be useful to be able to store some information in temp tables and then perform joins against it - all with the remote data. Creating the temp tables locally and joining against them over the wire is prohibitively slow. Is it possible to force the temp table to be created on the remote server? Assume I don't have sufficient privileges to create my own real (permanent) tables. 回答1: It's not possible to directly

Linked Server In SQL Server Express

a 夏天 提交于 2019-12-12 08:38:51
问题 I am developing an app where i have a local database in SQL Server Express. During work in local database, we need to execute a query on another SQL Server / live server and its return a value and with this value we execute a query in local server. It is OK when executing this query against 2 or 3 queries, but i have around 5000 records on which I need to execute same process. I have done with above style but its take too much time. I've found that we can run a query on multiple servers. Can

SQL Server : get access to linked server through linked server

喜夏-厌秋 提交于 2019-12-12 03:32:33
问题 I have SQL Server 2008 with linked server, for example Server1. Usually I execute queries like SELECT * FROM [Server1,1444].[DBName].[dbo].[Table1] But this time my target table is stored at different server. This server is linked on Server1 like Server2. So, DBA of Server1 gave me a this query SELECT * FROM [Server2].[DB].[dbo].[My_table] On Server1 this query runs without troubles, but when I try to run it on my own server like: SELECT * FROM [Server1,1444].[Server2].[DB].[dbo].[My_table]

“Data source name not found” when adding linked server

冷暖自知 提交于 2019-12-12 02:25:50
问题 I am trying to add a linked server to a sql server 2012 database using ssms 2012. the linked server is pervasive sql. here's how i am trying to do it: EXEC sp_addlinkedserver @server = 'kslap208', @provider = 'MSDASQL', @datasrc = 'C003', @srvproduct = 'Pervasive' GO however when i test the connection i am getting this error msg: what am i doing wrong? how can i link to an instance of a pervasive sql database? here is some additional information regarding the DSN to which I am trying to

Executing a Stored Procedure on a Linked Server

柔情痞子 提交于 2019-12-12 02:19:25
问题 I am running SQL Server 2012 on two separate servers (let's call them Server A and Server B). On Server A, I have created a linked server to Server B called [ServerB]. I am able to query Server B from Server A without any problems: SELECT * [ServerB].[MyDatabase].[dbo].[MyTable] However, when I try to execute a stored procedure: EXEC [ServerB].[MyDatabase].[dbo].[MyStoredProcedure] ...I get the following error: Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'. I've done a lot of Googling