linked-server

Slow query when connecting to linked server

*爱你&永不变心* 提交于 2019-12-23 07:53:05
问题 I've got this query UPDATE linkeddb...table SET field1 = 'Y' WHERE column1 = '1234' This takes 23 seconds to select and update one row But if I use openquery (which I don't want to) then it only takes half a second. The reason I don't want to use openquery is so I can add parameters to my query securely and be safe from SQL injections. Does anyone know of any reason for it to be running so slowly? 回答1: Here's a thought as an alternative. Create a stored procedure on the remote server to

Slow query when connecting to linked server

我怕爱的太早我们不能终老 提交于 2019-12-23 07:52:15
问题 I've got this query UPDATE linkeddb...table SET field1 = 'Y' WHERE column1 = '1234' This takes 23 seconds to select and update one row But if I use openquery (which I don't want to) then it only takes half a second. The reason I don't want to use openquery is so I can add parameters to my query securely and be safe from SQL injections. Does anyone know of any reason for it to be running so slowly? 回答1: Here's a thought as an alternative. Create a stored procedure on the remote server to

Linked server setup between SQL Server Express and SQL Server

自古美人都是妖i 提交于 2019-12-23 03:54:27
问题 Can you please explain how to setup a linked server between a SQL Server (A) and a SQL Server Express (B) scenario. Server A is SQL Server 2000, whereas Server B is SQL Server 2005 Express. I have set these up in the past, but none where connected to a SQL Server Express version. Thanks, Billy 回答1: You can use this sp to do it. EXEC sp_addlinkedsrvlogin @rmtsrvname = 'MylinkedServer', @useself = 'FALSE', @locallogin = NULL, @rmtuser = 'me', @rmtpassword = 'myrmtpassword' 回答2: You could try

Slow performance in linked server query

♀尐吖头ヾ 提交于 2019-12-23 01:54:53
问题 I'm using a Linked Server Query from MSSQL to mySql . MySql table to be queried has 800K + records I'm using a temp table to pull the results from linked server and do a join on that temp table for SQL query Is there a performance difference between: Declare @MyString varchar(max), @Address varchar(20), @tempTable (Address, ColumnB, ColumnC) set @MyString = 'Select Address, ColumnB, ColumnC from schemaname.tablename where ''' + convert(varchar(30),@Address) + ''') order by ColumnB desc limit

How to use a SQL2000 Linked Server to query an Oracle 11G table

和自甴很熟 提交于 2019-12-22 17:06:25
问题 Can someone help me construct the SQL that I need to query the Projects_dim table using the Linked Server "idwd"? To test the connection, I ran a sample query using the linked server name. To access the tables on the linked server, I used a four-part naming syntax: linked_server_name.catalog_ name.schema_name.table_name. replacing the values, you get: idwd.idwd.wimr.PROJECTS_DIM of should it be the following? idwd..wimr.PROJECTS_DIM The database name is "idw" but the grid below shows a blank

There is insufficient system memory in resource pool 'internal'

时间秒杀一切 提交于 2019-12-22 02:02:10
问题 SQL Server 2008 Linked Server and ad-hoc INSERTs cause a rapid memory leak which eventually causes the server to become non-responsive and ends with the following error: Msg 701, Level 17, State 123, Server BRECK-PC\SQLEXPRESS, Line 2 There is insufficient system memory in resource pool 'internal' to run this query. Location: qxcntxt.cpp:1052 Expression: cref == 0 SPID: 51 Process ID: 1880 The server remains non-responsive until SQL Server is restarted. Software in use: Windows Vista Ultimate

How to reference a sql server with a backslash (\) in its name?

人走茶凉 提交于 2019-12-21 03:37:04
问题 Givens: One SQL Server is named: DevServerA Another is named: DevServerB\2K5 Problem: From DevServerA , how can I write a query that references DevServerB\2K5 ? I tried a sample, dummy query (running it from DevServerA ): SELECT TOP 1 * FROM DevServerB\2K5.master.sys.tables And I get the error: Msg 102, Level 15, State 1, Line 2 Incorrect syntax near '\.'. However, I know my syntax is almost correct, since the other way around works (running this query from DevServerB\2K5 ): SELECT TOP 1 *

SELECT * FROM MySQL Linked Server using SQL Server without OpenQuery

删除回忆录丶 提交于 2019-12-20 10:34:22
问题 I am trying to query a MySQL linked server using SQL Server . The below query runs just fine. SELECT * FROM OPENQUERY([Linked_Server], 'SELECT * FROM Table_Name') Is it possible to run the same query without using the OpenQuery call? 回答1: Found the answer here. Now I can the three dot notation query. Thanks http://www.sparkalyn.com/2008/12/invalid-schema-error/ Go to the provider options screenIn SQL Server 2005 you can see the list of providers in a folder above the linked server (assuming

Possible with multiple database connections

余生颓废 提交于 2019-12-20 06:44:55
问题 New to the tSQLt world (great tool set) and encountered a minor issue with a stored procedure I am setting up a test for. If I for some reason have a stored procedure which connects to mutiple databases or even multiple SQL servers (Linked Servers). Is it possible to do unit tests with tSQLt in such a scenario? 回答1: I commented already, but I would like to add some more. So as I said already, that you can do anything that fits into the single transaction. But for your case I would suggest to

EF 6.1.3 with “linked server”

孤人 提交于 2019-12-20 03:36:30
问题 I am using the SQL Server 2012 and EF 6.1.3 I have a central database A and another database B which is linked to the database A. The two databases are used for two different applications. In the database B I have some views which is exactly as some table in the central database A. What I am expecting is that when I insert/update/delete records in views of the database B, those records will be inserted/updated/deleted in the central database A. For the application using the database B (this