Scalar Query In SQL Server 2000 Like In Oracle

Mar 28, 2008

Hi Gurus,

I have table (CallByCall) with following Data.

Input :
CallID Event DNIS UserID Time SeqID MobNo
-----------------------------------------------------------------------------
1 | 43 | 100 | |09:00:05 | 1 |
9833210770
1 | 40 | | |09:01:05 | 2
|
1 | 41 | | |09:02:05 | 3
|
1 | 42 | | 25 |09:03:05 | 4
|

2 | 43 | 200| |09:10:05 | 1 |
9833975536
2 | 40 | | |09:11:05 | 2
|
2 | 41 | | |09:12:05 | 3
|
2 | 42 | | 26 |09:13:05 | 4
|

3 | 43 | 300| |09:15:05 | 1 |
9813978536
3 | 40 | | |09:15:55 | 2
|
3 | 41 | | |09:16:05 | 3
|
3 | 42 | | 28 |09:18:05 | 4
|

4 | 43 | 100| |09:45:05 | 1 |
9223978896
4 | 40 | | |09:46:05 | 2
|
4 | 41 | | |09:47:05 | 3
|
4 | 42 | | 26 |09:48:05 | 4
|

Output:
CallID DNIS UserID MinTime MaxTime MobNo
--------------------------------------------------------------------------
1 | 100 | 25 |09:00:05 |09:03:05 |9833210770
2 | 200 | 26 |09:10:05 |09:13:05 |9833975536
3 | 300 | 28 |09:15:05 |09:18:05 |9813978536
4 | 100 | 26 |09:45:05 |09:48:05 |9223978896

In short I am getting DNIS and MobNo for Event 43 and
UserId for Event 42.

How can I achieve the above result?
Is it possible with scalar query?

Could any one help me for the same?

Thanking in Advance
Sanjeev

View 1 Replies


ADVERTISEMENT

Scalar Subquery In MS-SQL Server 2000

Mar 28, 2008

Hi Gurus,I have table (CallByCall) with following Data.Input :CallID Event DNIS UserID Time SeqID MobNo-----------------------------------------------------------------------------1 | 43 | 100 | |09:00:05 | 1 |98332107701 | 40 | | |09:01:05 | 2|1 | 41 | | |09:02:05 | 3|1 | 42 | | 25 |09:03:05 | 4|2 | 43 | 200| |09:10:05 | 1 |98339755362 | 40 | | |09:11:05 | 2|2 | 41 | | |09:12:05 | 3|2 | 42 | | 26 |09:13:05 | 4|3 | 43 | 300| |09:15:05 | 1 |98139785363 | 40 | | |09:15:55 | 2|3 | 41 | | |09:16:05 | 3|3 | 42 | | 28 |09:18:05 | 4|4 | 43 | 100| |09:45:05 | 1 |92239788964 | 40 | | |09:46:05 | 2|4 | 41 | | |09:47:05 | 3|4 | 42 | | 26 |09:48:05 | 4|Output:CallID DNIS UserID MinTime MaxTime MobNo--------------------------------------------------------------------------1 | 100 | 25 |09:00:05 |09:03:05 |98332107702 | 200 | 26 |09:10:05 |09:13:05 |98339755363 | 300 | 28 |09:15:05 |09:18:05 |98139785364 | 100 | 26 |09:45:05 |09:48:05 |9223978896In short I am getting DNIS and MobNo for Event 43 andUserId for Event 42.How can I achieve the above result?Is it possible with scalar query?Could any one help me for the same?Thanking in AdvanceSanjeev98332 10772

View 1 Replies View Related

DTS Between SQL Server 2000 And Oracle 8.1.7

Feb 11, 2004

Hi,

I used DTS Export Wizard to copy tables from SQL server 2000 to Oracle 8.1.7. After transfering completed successfully, I loged into oracle and tried to select data from the tables. I got 'table does not exist' error. But when I select table_name from oracle data dictionary, I saw tables exist in oracle. Then I opened SQL Query Analyzer, I can select data from the tables just transfered through linked oracle server.

Does anyone have same experience? Could someone please give me suggestion?

Thanks in advance!

View 4 Replies View Related

Oracle .dmp To SQL Server 2000

Apr 7, 2004

Hi guys,
I was given a task to get an Oracle .dmp file into SQL Server.
Is it even possible to do? Or do I have to script the Oracle DB and import the DB that way?
But then how would I get the data?

I need to get the Oracle structure and the Data over to SQL Server.

PLease help.

View 1 Replies View Related

Replication From Oracle To Sql Server 2000

Mar 3, 2003

Is it possible to replicate from Oracle to SQL Server.

Thanks,

Bianca

View 1 Replies View Related

Migrating From Oracle 8i To SQL Server 2000

Jan 31, 2004

Hi
I am trying to migrate my database in Oracle 8i to Sql Server 2000 but am unsure of how to carry out the migration. How do I do it and what do I have to consider. My OS is Windows 2003. Thanks in advance

View 2 Replies View Related

Exporting Sql Server 2000 Tables To Oracle 10.2G

Jan 10, 2008

Dear All,
I am working on a project to migrate a .net desktop application to web based application using ASP.NET 2.0.
The present app has lots of tables with data in sql server 2000. The new app is to have Oracle 10.2 G as data store.
Although the data store is being changed most of the tables in the present database will remain same along with the data they hold.
My problem is:
1) how to transfer the tables to the new datastore 10.2 G in an automated way?
After all it's not possible to create each table afresh in Oracle and then insert records into each table one by one. If that is done it will take atleast few months if not years.
2) can I export the tables to a xml file and then import it from Oracle.How to do that?
It has become a nightmare for me.
Pls suggest the easiest way and which takes the minimum time.
A solution to the problem will be gratefully accepted.
Thanks.

View 3 Replies View Related

Migrade Oracle Data To SQL Server 2000

Aug 1, 2005

I am doing a test on migrating an Oracle 8i database toSQL 2000. I've never done this before and I would liketo find out if there are any complications or side effectsif I try doing the transfer of data using DTS?If not DTS then what would you suggest I transfer datawith?Thank you

View 4 Replies View Related

Accessing Oracle Tables From Within SQL Server 2000

Mar 24, 2006

We are running SQL Server 2000 SP3. We have linked servers in use thatwe use to access Oracle tables.Recently the claim has been made that you can access Oracle tables fromwithin SQL Server without using a Linked Server. I searched BooksOnline using keywords: linked, remote, and Oracle and did not findanything.A search of the newsgroup archives found only entries related to usingLinked Servers.Is there any such method as claimed? I do not think there is, but Ineed to find some support for my position or else learn something new.Thank you-- Mark D Powell --

View 4 Replies View Related

Data Migration Oracle 7.16 To SQL Server 2000

Aug 22, 2006

Hi,

I have been asked to look at optimising a Data Migration Strategy for one of our clients. I am quite new to Data Migration (I'm actually a system designer!).

The migration is from a legacy Oracle 7.16 Db to a SQL Server 2000 environment.

The legacy Db has some large tables - 30 Million+ rows

Table/column Mapping is 1:1

At present we are using DTS to import into the SQL environment.

My question is: Is there any way to leverage the Oracle 7.16 export to speed up the migration process?

Any advice would be appreciated.

Many thanks

Mike

View 1 Replies View Related

Nested Scalar Query Problem

Jan 31, 2008



I'm having a trouble with a nested scalar query

I have a table that refers to itself, and I need to loop through it to get the total number of entries in the structure with an object_type of 40 this is the function I came up with to do this. The problem is that the nested function doesn't seem to get called.




Code Snippet
using System;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using System.Collections.Generic;
using Microsoft.SqlServer.Server;

public partial class StoredProcedures
{
private struct PerformanceCriteriaCounter
{
public PerformanceCriteriaCounter(int id, string objecttype)
{
Id = id;
Object_Type = objecttype;
}
public int Id;
public string Object_Type;
}

[Microsoft.SqlServer.Server.SqlProcedure(Name = "usp_PerformanceCriteriaCounter")]
public static int CountPerformanceCriteria(int ParentID, int SourcePosition)
{
using (SqlConnection conn = new SqlConnection("context connection=true"))
{
int Counter = 0;
int Counter2 = 0;
SqlContext.Pipe.Send("Called with ParentID=" + ParentID + " SourcePosition=" + SourcePosition);
conn.Open();
using (SqlCommand myCommand = conn.CreateCommand())
{
myCommand.CommandText = @"SELECT CompetenceLearningObject.Object_Type, CompetenceLearningObject.LearningObject_ID
FROM CompetenceLearningObjectParent INNER JOIN
CompetenceLearningObject ON CompetenceLearningObjectParent.LearningObject_ID = CompetenceLearningObject.LearningObject_ID
WHERE (CompetenceLearningObjectParent.Approved = 1) AND (CompetenceLearningObject.Archived = 0 OR
CompetenceLearningObject.Archived IS NULL) AND (CompetenceLearningObject.Approved_Status = 1) AND
(CompetenceLearningObjectParent.Parent_ID = @ParentID) AND (CompetenceLearningObjectParent.Position_ID = @SourcePosition)";
myCommand.Parameters.AddWithValue("@ParentID", ParentID);
myCommand.Parameters.AddWithValue("@SourcePosition", SourcePosition);
List<PerformanceCriteriaCounter> loList = new List<PerformanceCriteriaCounter>();
SqlDataReader reader = myCommand.ExecuteReader();
while (reader.Read())
{
SqlContext.Pipe.Send("Adding item");
loList.Add(new PerformanceCriteriaCounter(int.Parse(reader["LearningObject_ID"].ToString()), reader["Object_Type"].ToString()));
}
reader.Close();

foreach (PerformanceCriteriaCounter lo in loList)
{
SqlContext.Pipe.Send("Testing item, ObjectType =" + lo.Object_Type);
if (lo.Object_Type == "40")
{
SqlContext.Pipe.Send("Incrementing counter");
Counter++;
}
else
{
SqlContext.Pipe.Send("Calling procedure with ParentID=" + lo.Id + " and Position=" + SourcePosition);
using (SqlCommand myCommand3 = conn.CreateCommand())
{
myCommand3.CommandType = CommandType.StoredProcedure;
myCommand3.CommandText = "usp_PerformanceCriteriaCounter";
myCommand3.Parameters.AddWithValue("@ParentID", lo.Id);
myCommand3.Parameters.AddWithValue("@SourcePosition", SourcePosition);
object objValue = myCommand3.ExecuteScalar();
if (objValue != DBNull.Value)
{
Counter2 = Convert.ToInt32(objValue);
SqlContext.Pipe.Send("It's not null value=" + Counter2.ToString());
Counter = Counter + Counter2;
}
}
}
}
}
return Counter;
}
}
}






This is the output from SQL Server when I call the function.



Code Snippet
Called with ParentID=1 SourcePosition=89
Adding item
Adding item
Adding item
Adding item
Adding item
Adding item
Adding item
Adding item
Adding item
Adding item
Adding item
Adding item
Adding item
Testing item, ObjectType =30
Calling procedure with ParentID=2 and Position=89
It's not null value=0
Testing item, ObjectType =30
Calling procedure with ParentID=3 and Position=89
It's not null value=0
Testing item, ObjectType =30
Calling procedure with ParentID=4 and Position=89
It's not null value=0
Testing item, ObjectType =30
Calling procedure with ParentID=5 and Position=89
It's not null value=0
Testing item, ObjectType =30
Calling procedure with ParentID=6 and Position=89
It's not null value=0
Testing item, ObjectType =30
Calling procedure with ParentID=7 and Position=89
It's not null value=0
Testing item, ObjectType =30
Calling procedure with ParentID=8 and Position=89
It's not null value=0
Testing item, ObjectType =20
Calling procedure with ParentID=9 and Position=89
It's not null value=0
Testing item, ObjectType =20
Calling procedure with ParentID=10 and Position=89
It's not null value=0
Testing item, ObjectType =20
Calling procedure with ParentID=11 and Position=89
It's not null value=0
Testing item, ObjectType =20
Calling procedure with ParentID=12 and Position=89
It's not null value=0
Testing item, ObjectType =20
Calling procedure with ParentID=13 and Position=89
It's not null value=0
Testing item, ObjectType =20
Calling procedure with ParentID=14 and Position=89
It's not null value=0





You can see it adding and checking the values and attempting to call itself, but it never seems to get re-called, any ideas?

Cheers

Jon

View 3 Replies View Related

How To Query An Oracle Data From SQL Server Query Analyser

Sep 3, 2007



Hi ,

I am having 2 data store .
1. Oracle 10g
2 SQL server 2000

My requirement is that , i need to insert some data from sql server database table to oracle database using sql server query analyser or interface.


If there is any way ,plz let me know it


Thanks
Abraham

View 3 Replies View Related

Automating The Importation Of An Oracle Table Into Sql Server 2000

Aug 25, 2004

Hi guys,

I figure this should not be a complex one. I know how to manually pull in data from Oracle 9i into SQL Server 2000 using DTS. However this is my issue.....

I simply want to automate the pulling in of data from 1 table in my ORACLE 9i database into another table in my Sql Server 200. I was hoping I could simple write a stored procedure that would sort of utilize a dblink like in ORACLE and then schedule that procedure. Is this feasible in Sql Server, and how would one go about setting this automated import up????

Thanks in Advance all............

'Wale

View 5 Replies View Related

How To Import An Oracle 8.1.7 Dump File Into SQL Server 2000 ?

Mar 2, 2005

Hi,
I do not know if it can be done:
how to import an Oracle dump file into SQL server ?

That dump file contains the content of a table, excported from Oracle.
Is there a way or another to import it to SQLServer 2000 ?

Thanks

View 2 Replies View Related

How To Do Pair-wise Comparision Like Oracle In MS Sql Server 2000?

Apr 18, 2008



How can we do pair wise comaprission using Sub query as generally can be done in Oracle?


Thanx

View 4 Replies View Related

How To Link/connect To Oracle Server From SQL Server 2000?

Oct 6, 2005

Greetings,
I want to connet to Oracle databse from SQL server 2000 since I am more comfortable with SQL 2000 client package. The oracle server is 8i or above.
I am running a SQL Server 2000 on a PC with Windows XP OS.
Please help what I need to do and configuration information.

Thank you all in advance.

BPG

View 1 Replies View Related

Setting A Value Of The Query Result To Scalar Variable

Mar 26, 2006

Hi!

Is it possible to set a query result (scalar) to scalar variable. I would like to set a qery result (SELECT COUNT(*) FROM MyTable) to a scalar variable:

DECLARE @temp int

SET @temp = query result...

Is it possible? I couldn't find the way to do that...

View 1 Replies View Related

Accessing SQL Server Data From Oracle Developer 2000 Apps

Feb 17, 1999

Hello there

I have a customer that wants to start using SQL Server 7.0 instead of Oracle, but they have a lot of Oracle applications (made in Developer 2000 and Forms). Due to the big effort needed to convert those applications (to Visual Basic), they want to be able somehow to migrate only data from Oracle to SQL Server, and then use some tool that will allow them to use the same applications with the SQL Server 7.0 engine.

I found on the "SQL Server Developer's Kit" a document describing the process of migrating data and applications from Oracle to SQL Server. There is a mention to an Oracle tool called "Oracle Gateway to SQL Server" that will translate calls received by the Oracle engine to the SQL Server engine, but this approach will still require the existence of Oracle servers (which is the thing the customer no longer wants).

The second option mentioned on that document, and the one that seems more attractive, is the use of Oracle "Open Client Adapter" (OCA) that will allow Developer 2000 applications to communicate directly to SQL Server via ODBC. However, I have been unable to find (on the Oracle site) any documentation regarding this tool.

Has anynoe heard or used such tool (OCA) ? Any comments, tips, drawbacks, experience you could share ? Any other idea on how a thing like that could be accomplished ? Perhaps a third-party application that can act as a gateway between the Forms app and ODBC/SQL Server, or that will be able to generate VB code from a Developer 2000/Forms app...

Any help will be appreciated.

Please respond directly to me, as I am not a member of the distribution list.

Luis Francisco Silva

View 1 Replies View Related

Executing (from Sql Server 2000) Procedures From Oracle Package Through Linkserver

Feb 16, 2004

Hello,

I deaply need to know how to execute procedures from package in oracle, from sqlserver 2000 using linkserver.

Thank you very much,
Victor
DBA

View 2 Replies View Related

Linked Server From SQL-Server 2000 To Oracle 8.1.7

Jul 20, 2005

We have a linked server, which worked fine, but we have just changedthe collation sequence, in SQL-Server, fromSQL_Latin1_General_CP1_CI_AS to Latin1_General_CI_AS.Now trying to use the Linked server, we get the following message:"Error 7399: OLE DB Provider 'MSDAORA' reported an error. The providerdid not give any information about the error. OLE DB error trace [OLEDB provider 'MSDAORA' IDBInitialize::Initialize returned 0x80004005:The provider did not give any information about the error]."Ha anyone seen this before, because I am not sure why changing thecollation sequence, would affect the Linked Server

View 3 Replies View Related

How To Query SQL Server Using Oracle

May 10, 2001

I was wondering if anyone knew how to query SQL Server using Oracle 8i?

I want to retrieve a recordset and then insert that same data into my tables within Oracle.

Is there a way to do this?

Thanks!

View 2 Replies View Related

Oracle Query In SQL Server

May 27, 2004

Hi,

I want to write this query in sql server. Please help me, it is very urgent :(

Any help will be appreciated.

SELECT VALID_ITEM.PC_CODE,PC_TITLE,VALID_ITEM.DB_CONTRACT ,
valid_item.ITEM_NO,DESCPT,UNITS,CONTQ,
CONTR_PRICE ,nz(QTD,0) as qtd,ind_ovr_und,
nz(QTD,0) - NVL(QUANTITY,0) as QUANT_PREV,
Nz(QUANTITY,0) as quant_rev,
round(NVL(quantity,0)*nvl(CONTR_PRICE,0),2) as QTD_VAL,
AMT_PAID_ITEM,AMT_RET_ITEM
FROM VALID_ITEM, cqe_item,CONTRACT_PC
WHERE valid_item.db_contract = contract_pc.db_contract
and valid_item.pc_code = contract_pc.pc_code
and valid_item.db_contract = cqe_item.db_contract (+)
and cqe_item.cqe_numb (+) = :EST_NO
and valid_item.item_no = cqe_item.item_no (+)
and valid_item.pc_code = cqe_item.pc_code (+)
order by valid_item.item_no

View 7 Replies View Related

Query In Oracle &&amp; SQl Server

Nov 1, 2007

Hi All,

I need the basic information about how the query is working in Oracle & SQl Server.

Sicne I am getting different values when I run the query. I have a table called 'Client_Master' in both the DB
(ie., Oracle & SQL). I have inserted a record with the below values for Client_Master table. (both Oracle & SQl).

Inserted Values:
----------------
Start_Code = 90
End_code = ''

The query is :

SELECT * FROM CLIENT_MASTER
WHERE ID = '200'
AND ((START_CODE <= '102' AND END_CODE >= '102')
OR (START_CODE <= '200' AND END_CODE >= '200')
OR (START_CODE >= '102' AND END_CODE < '200')
OR (START_CODE = '102' AND END_CODE is null))

Oracle result : No rows return.
SQl Server : one row returned.

Data type for start_code & end_code are 'NVARCHAR2 (40)'.

I would highly appreciate if anyone can explain why is this and any suggestion like how to handle this in both the database.

The subject of this query is the values which is entered by the user should not be overlapped. But I dont how to handle
this if it is alphanumeric.

Thnx,

View 5 Replies View Related

Query Oracle From SQL Server

Oct 12, 2007



Hello

I want to Query Oracle from SQL server stored procedures. Is this possible, i have Oracle 9 client installed on my machine.

Please tell me details, i have no idea how to do that.

Thanks

View 1 Replies View Related

Query SQL Server From Oracle

Oct 15, 2007

Hi!
Somebody know how can I access to my SQL Server from Oracle to call a stored procedure and get le result in a Oracle costum TYPE?

Is there any article about this?

Thanks for your help

View 1 Replies View Related

Conversion Of Query From Oracle To SQL Server

Sep 12, 2007

Hi Friends,
Need ur help desperately. I am stuck with one of the queries which i had written in Oracle and need the same in SQL Server.Please have a look at the following query :

select * from r_tin_1099_info where instr(translate( nm_ctrl_cd , '~!@#$%^&*()_+}{":?><`-=]['''';/., ', '*******************************' ),'*') > 0;

Basically my purpose is to replace the values in column NM_CTRL_CD having wild card characters with '*' and then select this rows to display.

However i am not able to run the same query in SQL Server since TRANSLATE is not a built in func. I have tried a lot to replace it but could only one func : REPLACE . But the same will not replace any one of the above wild characters but will replace the entire pattern.Please note that it should be able replace even if one of the wild card characters are present in the string and not necessarily the entire pattern shown above.

please reply ASAP since i am working and need this query to fix a defect.


Thanks in advance.

View 9 Replies View Related

Query Oracle Linked Server

Jul 8, 2013

I run a query using an Oracle Linked Server.

This seems to run forever.
SELECT * FROM LinkedServer..Schema.View WHERE TN= '2034561295'

...and any other field in the where clause work fine.

SELECT * FROM LinkedServer..Schema.View WHERE SPID= '8088'

View 3 Replies View Related

SQL Server + Oracle Data Linked In One Query

Jun 9, 2006

I need to link some data from SQL Server 2005 with Oracle 10 data.One way is to link Oracle server to SQL Server and use ROWSOURCE forretrieving data.What other ways for joing data from both databases exist ?Can I do it from SQLCRL VB - Stored Procedure ? If yes, what objectsshall I use for opening database and running an sql ?
When I tried to import system.data.oracleclient, it was not available. Do I need to install anything for being able to use it ?
Thanks a lot.

View 4 Replies View Related

Executing An Oracle SP From SQL Server Query Analyzer

May 3, 2000

Does anybody know the syntax for Executing an Oracle SP from SQL Server Query Analyzer? The Oracle database is linked to the SQL Server. Thanks.

View 1 Replies View Related

SQL Server Equivalent For The Oracle Join Query

Nov 30, 2004

Hi,

Kindly give the SQL Server equivalent for the below Oracle query :

select *from t1, t2, t3 where
t1.t1col1 (+) = t2.t2col1 and
t2.t2col1 (+) = t3.t3col1

Thanks,
Sam

View 14 Replies View Related

SQL Server + Oracle Data Linked In One Query

Jun 8, 2006

I need to link some data from SQL Server 2005 with Oracle 10 data.One way is to link Oracle server to SQL Server and use ROWSOURCE forretrieving data.What other ways for joing data from both databases exist ?Can I do it from SQLCRL VB - Stored Procedure ? If yes, what objectsshall I use for opening database and running an sql ?Thanks a lot.

View 3 Replies View Related

Query To Oracle Via Linked Server Hangs

Apr 13, 2007

Basic description:

We have developed a solution that sends data from SQL Server to an Oracle server as the result of a stored procedure called by a job that runs every minute. While this development worked fine in our test environment, after moving it to production it ran successfully the first minute, but the second minute the stored procedure hung, and the process could not be killed. In order to stop the process I had to stop both the SQL Agent and the MSDTC services.



Our SQL Server box:
SQL Server 2000 Standard Edition SP4
Windows 2003 Server R2 SP1

Our Oracle box:
Test: Oracle 9.2.0.6
Production: Oracle 9.2.0.4



To setup the SQL box, I did the following:
1) Install Oracle Client Tools version 10.2.0.1
2) Restart Server
3) Modify the registry as follows:
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftMSDTCMTxOCI] "OracleXaLib"="oraclient10.dll" "OracleSqlLib"="orasql10.dll" "OracleOciLib"="oci.dll"
4) Modified the PATH variable so that all references to SQL Server appear in front of Oracle path references
5) Added the linked server via sp_addlinkedserver '<tns name>','Oracle','MSDAORA','<tns name>'
6) Added linked server logins via sp_addlinkedsrvlogin '<tns name>','False','<SQL user>','<Oracle User name>','<password on oracle>'
7) Changed the registry for MSDTC to match this:

[HKEY_LOCAL_MACHINESOFTWAREMicrosoftMSDTC]
"AllowOnlySecureRpcCalls"=dword:00000000
"FallbackToUnsecureRPCIfNecessary"=dword:00000001
"TurnOffRpcSecurity"=dword:00000001

[HKEY_LOCAL_MACHINESOFTWAREMicrosoftMSDTCSecurity]
"NetworkDtcAccess"=dword:00000001
"NetworkDtcAccessAdmin"=dword:00000001
"NetworkDtcAccessClients"=dword:00000001
"NetworkDtcAccessTransactions"=dword:00000001
"NetworkDtcAccessTip"=dword:00000001
"XaTransactions"=dword:00000001
"DomainControllerState"=dword:00000000
"AccountName"="NT Authority\NetworkService"
"NetworkDtcAccessOutbound"=dword:00000001
"NetworkDtcAccessInbound"=dword:00000001

8) Stopped and restarted services in the following order:
1) MSDTC Stop
2) SQL Server Stop
3) MSDTC Start
4) SQL Server Start



The stored procedure:
In a single transaction, the stored procedure compares a production table against a logging table. If a record exists in the production table that is not in the logging table, a record is inserted into logging table, and a record sent to Oracle via an INSERT INTO OPENQUERY('INSTANCE','SELECT Column1, column2, column3,... FROM SCHEMA.TABLE')
SELECT column1,column2,column FROM SQLTable

This stored procedure has worked just fine for us in test, to either the test or production Oracle boxes, but it now fails, and hangs, in production to either the test or production Oracle boxes.



Additionally, I can run the following query via Query Analyzer from our test box to both the test Oracle and production Oracle and it runs successfully (this is NOT used in our stored procedure code, but is presented here as an indication that I think there is something wrong with the settings on our production SQL box):

SELECT * FROM OPENQUERY('INSTANCE','SELECT * FROM SCHEMA.TABLE')



When I run this same query via Query Analyzer on our Production SQL box, to either the test Oracle or production Oracle, it hangs, and I have to kill the process, and restart the MSDTC service.
Other queries that hang are:
SELECT * FROM SERVER..SCHEMA.TABLE



Additionally, I noticed that when I used this method to kill the process I would see errors like the following in the Application Event Log on the SQL box:

The XA Transaction Manager attempted to perform recovery with the XA resource manager. The XA resource manager reported that recovery was unsuccessful. DSN = MTxOCI.Dll.

Since I figured this was an aborted transaction still residing in the MSDTC log file, I would stop the MSDTC service, delete the MSDTC log file, reset the MSDTC log, and then restart the MSDTC service in order to prevent this error from occurring.



Not ALL queries from the production SQL box to production and test Oracle boxes fail. I can get results returned for this query:

SELECT COLUMN1, COLUMN2 FROM SERVER..SCHEMA.TABLE

I've been scouring the internet for about a week now, and I've run out of ideas on what to check on the production SQL box. Any suggestions would be greatly appreciated.

Tim



View 6 Replies View Related

Outer Join Oracle Query Translate In Sql Server

Apr 16, 2004

Hi,
I have this oracle query with outer join situation. how can i convert it into sql server query.

SELECT distinct ae.dB_CONTRACT,CP.PC_CODE,BID_ITEM.ITEM_NO,
'N',BID_ITEM.PRICE_WORDS,OFF_ITEM.DESCPT,
OFF_ITEM.UNITS,OFF_ITEM.TYPE_ITEM,
PRES_ITEM.RET_PERC
FROM BID_TOTAL,BID_ITEM,OFF_ITEM,PRES_ITEM, AE_CONTRACT AE, CONTRACT_PC CP
WHERE RANK_NUMB = 1
AND BID_TOTAL.DB_CONTRACT = 37044
AND BID_TOTAL.DB_CONTRACT = BID_ITEM.DB_CONTRACT
AND BID_TOTAL.BID_VENDOR = BID_ITEM.BID_VENDOR
AND BID_ITEM.DB_CONTRACT = OFF_ITEM.DB_CONTRACT
AND BID_ITEM.ITEM_NO = OFF_ITEM.ITEM_NO
AND OFF_ITEM.ITEM_NO = PRES_ITEM.ITEM_NO (+)
AND AE.DB_CONTRACT=BID_TOTAL.DB_cONTRACT
AND CP.DB_CONTRACT = AE.DB_CONTRACT
AND CP.pc_code = 1

Any Help will be appreciated.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved