linked-server

“Requested conversion is not supported” using a linked server and ODBC

試著忘記壹切 提交于 2019-12-11 09:46:10
问题 Our web application stores UTF-8 encoded data in VARCHAR fields. Recently, we have provided our customers access to this data via ODBC using DataDirect's OpenAccess ODBC driver. This is achieved using DataDirect's OpenAccess SDK, writing a C# .Net class to interface with the service. We only allow customers to perform SELECT queries. We also limit results to 100K rows at this time. This solution really works great, except querying fields with some of this encoded data appeared as gibberish to

migrating multiple linked server from one server to another on sql server 2008 R2

Deadly 提交于 2019-12-11 07:25:48
问题 I have 25 linked server(which will connect remote sql server 2000) working perfectly on one server, i even don't know login information of those linked server. My current environment is sql server 2008 R2, my new environment is also sql server 2008 R2 , i just need to migrate all linked server from old to new, preserving all login information Possible? 回答1: If you're dealing with linked servers that have specific users specified with password then I don't think you'll be able to preserve that

Using linked server returns error - “Cannot obtain the schema rowset for OLE DB provider”

拟墨画扇 提交于 2019-12-11 05:28:07
问题 I tried to move data aka ETL from one sql server to another as mentioned in a previous question - Copy data from one column into another column. Now, I get an error when I try to execute a query. Query - INSERT INTO [Target_server].[Target_DB1].[dbo].[Target_Table1](Target_Column1) SELECT Source_Column222 FROM [Source_server].[Source_DB1].[dbo].[Source_Table1] WHERE Source_Column1 = 'ID7162' Error - OLE DB provider "SQLNCLI" for linked server "MYLINKEDSERVER" returned message "Unspecified

Unable to Query a View from a Linked SQL Server

安稳与你 提交于 2019-12-11 05:26:34
问题 In SQL Server Management Studio, I have linked a SQL Server, sql02 to my local server as such: sp_addlinkedserver 'sql02' GO I can query tables from this server: SELECT * FROM SQL02.SomeDatabase.dbo.SomeTable However, when I try to query a view, as in SELECT * FROM SQL02.SomeDatabase.dbo.SomeView I get the following error message: Msg 7314, Level 16, State 1, Line 1 The OLE DB provider "SQLNCLI10" for linked server "SQL02" does not contain the table ""SomeDatabase"."dbo"."SomeView"". The

SQL Linked Server query with Parameters

风流意气都作罢 提交于 2019-12-11 05:16:48
问题 I need to select value from SQL Linked Server & get it to loacal variable This is what I've written so far: DECLARE @SQLQUERY AS VARCHAR(1000) DECLARE @FINALQUERY AS VARCHAR(1000) DECLARE @OutVal AS VARCHAR(10) SET @SQLQUERY = 'SELECT Field1 FROM Table1 WHERE Field2=' + CAST(@var1 AS VARCHAR) SET @FINALQUERY = 'SELECT @OutVal=Field1 FROM OPENQUERY(LINKEDSERVER,' + '''' + @SQLQUERY + '''' + ')' EXEC(@finalQuery) but this is wrong as it does not set the local variable(@OutVal). 回答1: Instead of

Distributed Transaction Error Only Through Code

倖福魔咒の 提交于 2019-12-11 05:01:54
问题 I and trying to perform a query against a linked server (SQL Server 2008 linked to Sybase) and select it into a temp table. Is works perfectly though a query window in SQL Management Studio, but when I do it through code (C#) it fails with the error "The operation could not be performed because OLE DB provider "ASEOLEDB" for linked server "MYLINKEDSERVER" was unable to begin a distributed transaction. I am not using a transaction in code with my DbConnection. This query looks like this:

Sql Server Linked Server Issue "Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'

孤街醉人 提交于 2019-12-11 03:20:50
问题 I have a domain user on both linked server and server which is referring the linked server. Same domain user is added to the pool identity of web supplication ( asp.net). What is happening, that application is successfully accessing the local DB and all data is coming fine. But when application try to access the stored procedure which is calling linked server it shows the following error "Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON" But more annoying is that it does not fail always,

SQL Server Error: “maximum number of prefixes. The maximum is 3” with subselect syntax

冷暖自知 提交于 2019-12-11 01:09:24
问题 Trying to run a cross-server update: UPDATE asilive.Contoso.dbo.lsipos SET PostHistorySequencenNmber = ( SELECT TransactionNumber FROM Transactions WHERE Transactions.TransactionDate = asilive.CMSFintrac.dbo.lsipos.TransactionDate) Gives the error: Server: Msg 117, Level 15, State 2, Line 5 The number name 'asilive.Contoso.dbo.lsipos' contains more than the maximum number of prefixes. The maximum is 3. What gives? Note: Rearranging the query into a less readable join form: UPDATE asilive

Optimisation of an oracle query

大城市里の小女人 提交于 2019-12-11 00:33:25
问题 I'm trying to make my query run as quickly as possible but i'm struggling to get it under 5 seconds. I think it's because i'm referencing two linked databases Here's my query select column2, column3, column4 from table1@dev where column1 in ( select distinct column2 from table2@dev where column3 > 0 ) order by column1 Is there a way to optimise this query any more? I've tried using join but it seems to make the query run longer Thanks in advance EDIT From further investigation the DRIVING

How to Insert into remote table using Linked server withint Transaction?

限于喜欢 提交于 2019-12-10 20:50:31
问题 My Linked server is setup correctly , I am able to perform below query. INSERT INTO [RemoteServer].[Table] SELECT * FROM [LocalServer].[Table] However when I do the same thing within transaction BEGIN TRAN INSERT INTO [RemoteServer].[Table] SELECT * FROM [LocalServer].[Table] COMMIT TRAN I get Errors like OLE DB provider "SQLNCLI" for linked server "66.70.123.202" returned message "No transaction is active.". Msg 7391, Level 16, State 2, Line 3 The operation could not be performed because OLE