linked-server

Cannot initialize the data source object of OLE DB provider “Microsoft.ACE.OLEDB.12.0” for linked server

两盒软妹~` 提交于 2019-12-02 04:37:21
I'm trying to establish a linked server from SQL Server 2008 R2 to an Access database . The Access database is not password protected. As I have seen in other posts ( specifically this one ), this is usually due to the current user not having access to the Temp folder inside the NetworkService folder. Since we are running this in Windows Server 2008 , the directory structure is quite different than what most are eluding to. I have allowed access to every temp folder in the "root:\Documents and Settings\" directory , and to no avail. This is the procedure I am using to add the linked server:

Passing string parameters to linked Oracle Server procedures from SQL Server

白昼怎懂夜的黑 提交于 2019-12-02 00:16:52
I have an Oracle procedure called P_CREATE_USER . It takes a single varchar2 parameter: create or replace PROCEDURE P_CREATE_USER (P_USERID varchar2) ... I can run this from Oracle as EXEC P_CREATE_USER('MyUserId') We have the Oracle server linked to our SQL Server. I've tried: EXECUTE('P_CREATE_USER(''MyUserId'')') AT ORACLE_SERVER For my trouble, I get: OLE DB provider "OraOLEDB.Oracle" for linked server "ORACLE_SERVER" returned message "ORA-00900: invalid SQL statement". Msg 7215, Level 17, State 1, Line 1 Could not execute statement on remote server 'ORACLE_SERVER'. I have tried a number

EF 6.1.3 with “linked server”

爷,独闯天下 提交于 2019-12-01 23:35:02
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 is the linked server, not the central database), I am using the EF to generate views (using power tools)

Calling an Oracle function from SQL Server Linked Server

老子叫甜甜 提交于 2019-12-01 23:05:45
I have setup a linked server pointing to an Oracle DB. I want to call a function ABC in a package XYZ passing parameter K. What will be the syntax to do this? Hemanshu Bhojak I used the following syntax and it worked for me. EXECUTE (Query, Parameters) AT LinkedServerName Example: EXECUTE ( 'BEGIN ? := Package.MyFunction(?,?); END;', @ReturnValue, @InputPara, @OutputPara OUTPUT ) AT LinkedServerName Important Points: Don't forget the BEGIN and END syntax when calling functions Don't forget the semicolon at the end "END**;**" For using the above syntax you need to enable RPC for the linked

TRY CATCH with Linked Server in SQL Server 2005 Not Working

杀马特。学长 韩版系。学妹 提交于 2019-12-01 20:55:29
I am trying to catch sql error raised when I execute a stored procedure on a linked server. Both Servers are running SQL Server 2005. To prove the issue I have created a stored procedure on the linked server called Raise error that executes the following code: RAISERROR('An error', 16, 1); If I execute the stored procedure directly on the linked server using the following code I get a result set with 'An error', '16' as expected (ie the code enters the catch block): BEGIN TRY EXEC [dbo].[RaiseError]; END TRY BEGIN CATCH DECLARE @ErrMsg nvarchar(4000), @ErrSeverity int; SELECT @ErrMsg = ERROR

In SQL server, how can I query an Oracle Timestamp column over a Linked server connection?

会有一股神秘感。 提交于 2019-12-01 19:45:33
The query I have made in oracle does not work with linked server with sql server 2008. The OLE DB provider "MSDAORA" for linked server "ORACLE" supplied invalid metadata for column "DATETIME_INS". The data type is not supported. The query: select * from ORACLE..U_GERAN.CELLSTATS4 What are the modification that must be done to execute the query. Try, SELECT * FROM OPENQUERY(ORACLE, 'select cast(DATETIME_INS as DATE) from U_GERAN.CELLSTATS4') You can add the other columns to the query once that column works. 来源: https://stackoverflow.com/questions/9869892/in-sql-server-how-can-i-query-an-oracle

How to execute store procedure for another DB?

Deadly 提交于 2019-12-01 17:33:37
I have a stored procedure that should be able to be executed on any table of any database on my MS Sql Server. Most of the combination of EXEC and USE statements didn't result in anything. Here is the stored procedure: CREATE PROCEDURE [dbo].[usp_TrimAndLowerCaseVarcharFields] ( @Database VARCHAR(200), @TableSchema VARCHAR(200), @TableName VARCHAR(200) ) AS BEGIN DECLARE @sSql VARCHAR(MAX) SET @Database = '[' + @Database + ']' SET @sSql = '' -- Create first part of a statement to update all columns that have type varchar SELECT @sSql = @sSql + COLUMN_NAME + ' = LOWER(RTRIM(' + COLUMN_NAME + ')

Linked Server Performance and options

ぐ巨炮叔叔 提交于 2019-12-01 15:52:12
At work we have two servers, one is running an application a lot of people use which has an SQL Server 2000 back end. I have been free to query this for a long time but can't add anything to it such as stored procedures or extra tables. This has lead to us having a second SQL Server linked to the first one and me building up a library of stored procedures that query data from both sides using linked server. Some of these queries are taking longer than what I would like. Can someone point me to some good articles about using linked servers? I am particularly interested in finding out what data

Linked Server Performance and options

◇◆丶佛笑我妖孽 提交于 2019-12-01 15:34:40
问题 At work we have two servers, one is running an application a lot of people use which has an SQL Server 2000 back end. I have been free to query this for a long time but can't add anything to it such as stored procedures or extra tables. This has lead to us having a second SQL Server linked to the first one and me building up a library of stored procedures that query data from both sides using linked server. Some of these queries are taking longer than what I would like. Can someone point me

Can I join data from 2 different DB2 databases? (Like SQL Server linked databases)

…衆ロ難τιáo~ 提交于 2019-12-01 04:21:02
I'm enhancing an existing java application. There is data in 2 different DB2 databases. The app already gets data from 2 different databases, but it always does a lookup from one and then the other. Is there a way to join data from 2 different DB2 databases using one SQL SELECT? This is what I tried: CREATE ALIAS remote_orders FOR remote_db.schema.orders; select * from myid.remote_orders a inner join local_schema.parts b on (a.key = b.key) with ur FETCH FIRST 200 ROWS ONLY I get this error: STATEMENT REFERENCE TO REMOTE OBJECT IS INVALID. SQLCODE=-512, SQLSTATE=56023, DRIVER=4.14.113 Can I do