Can I define a SQL Server View to Oracle data?

So I have a subset of data whose source of truth resides in an Oracle Database. Can I define a SQL Server View to retrieve this subset of data and make it available on the SQL Server side for say Reporting and SSRS? I think I also saw where they tend to
prefer User-Defined functions as opposed to a view. If I define the view using an OPENQUERY, I have noticed that it seems to run FOREVER on the SQL Server side and returns pretty timely if I run in Oracle SQL Developer. Is there anything I can tweak to improve
this timeliness or lack there of?
And the whole reason I'd like to create a view of this Oracle data is so that I can take advantage of all the views and functions that we have created on the SQL Server side.
Has anyone gone down this path and can offer some advice and web sites or YouTubes as to the best way to approach this?
Thanks for your review and am hopeful for a reply while I keep Googling this.

There are couple of ways by which you can connect and fetch the data
OPENQUERY - which you are already using [uses linked server] -
runs on remote server
OPENROWSET - I would like to avoid this because it requires crenditials
OPENDATASET - Similar issue like OPENROWSET
Directly access linked server like LINKEDSERVER.DATABASE.SCHEMA.TABLE -
runs on your local server
Now, performance
basically, they have the same performance advantages and disadvantages when connecting to remote server. But you can enhance it by 
Avoiding data conversion 
Using procedure on Oracle and then call it from SQL Server (due to compiled plan your result will be faster)
Avoiding dealing with complex data types
If you are dealing with large number of records, try using Oracle connector in SSIS. I found it working much better than SQL sometimes.
Hope this will help
Glad to help! Please remember to accept the answer if you found it helpful. It will be useful for future readers having same issue.
My Profile on Microsoft ASP.NET forum

Similar Messages

  • ORA-01841 Converting SQL Server DateTime to Oracle Date

    I have Oracle 11gR2 x64 running on my Win7 Enterprise x64 personal system. I'm trying to convert the TSQL to create a database in SQL Server 2008 Express for my C# class to Oracle, and I've run into a "interesting" problem loading date data.
    The SQL Server 2008 TSQL InvoiceDate column in the Invoices table has datatype DATETIME:
    *[InvoiceDate] [datetime] NOT NULL,*
    which Oracle does not support. The Oracle InvoiceDate column in the MMAB_Invoices table has datatype DATE:
    InvoiceDate DATE NOT NULL,
    The fun begins with the TSQL INSERT statements (for example):
    INSERT [dbo].[Invoices] ([InvoiceID], [CustomerID], [InvoiceDate], [ProductTotal], [SalesTax], [Shipping], [InvoiceTotal]) VALUES (18, 20, CAST(0x00009CFD00000000 AS DateTime), 151.0000, 11.3300, 6.2500, 168.5800)
    As you can see, whoever wrote the load script thought it would be totally awesome to convert hex (binary?) data to generate a date, instead of using data readable by a human being.
    BTW, the date generated is 2010-01-13 00:00:00.000.
    After Reading The Fabulous Manual and searching the OTN Discussion Fora, what I came up with is
    INSERT INTO MMAB_Invoices (CustomerID, InvoiceDate, ProductTotal, SalesTax, Shipping, InvoiceTotal) VALUES (20, TO_DATE(UTL_RAW.CAST_TO_VARCHAR2(HEXTORAW('00009CFD00000000')), 'YYYY-MM-DD HH:MI:SS'), 151.0000, 11.3300, 6.2500, 168.5800);
    which returned
    Error starting at line 846 in command:
    INSERT INTO MMAB_Invoices (CustomerID, InvoiceDate, ProductTotal, SalesTax, Shipping, InvoiceTotal) VALUES (20, TO_DATE(UTL_RAW.CAST_TO_VARCHAR2(HEXTORAW('00009CFD00000000')), 'YYYY-MM-DD HH:MI:SS'), 151.0000, 11.3300, 6.2500, 168.5800)
    Error report:
    SQL Error: ORA-01841: (full) year must be between -4713 and +9999, and not be 0
    *01841. 00000 - "(full) year must be between -4713 and +9999, and not be 0"*
    **Cause: Illegal year entered*
    **Action: Input year in the specified range*
    The PK InvoiceID is automatically generated by a BEFORE INSERT trigger that uses a sequence.
    Suggestions?
    Thanks.
    P.S. Happy New Year!!!

    Your hex conversion is certainly not returning a date format:
    sql> select UTL_RAW.CAST_TO_VARCHAR2(HEXTORAW('00009CFD00000000')) from dual;
    UTL_RAW.CAST_TO_VARCHAR2(HEXTORAW('00009CFD00000000'))
      ┐²To convert the hex number to decimal, simply use to_number:
    sql> select to_number('00009CFD00000000', 'xxxxxxxxxxxxxxxx') from dual;
    TO_NUMBER('00009CFD00000000','XXXXXXXXXXXXXXXX')
                                          1.7261E+14Now, before you can make any further calculations with that number, you need to know how it represents the date of 2010-01-13. Luckily, we've got Google nowadays. ;-)
    Sql server representation seems to be an 8 byte field. The first 4 bytes stores the number of days since SQL Server's epoch (1st Jan 1900). The second 4 bytes stores the number of milliseconds after midnight.
    sql> select to_number('00009CFD', 'xxxxxxxxxxxxxxxx') from dual;
    TO_NUMBER('00009CFD','XXXXXXXXXXXXXXXX')
                                       40189
    sql> select to_date('1900-01-01','yyyy-mm-dd') + 40189 from dual;
    TO_DATE('
    13-JAN-10So, the conversion would be something like this:
    sql> select to_date('1900-01-01','yyyy-mm-dd') + to_number(substr('00009CFD00000000',1,8), 'xxxxxxxx') + to_number(substr('00009CFD00000000',9,8), 'xxxxxxxx') / (24*60*60*1000) from dual;
    TO_DATE('
    13-JAN-10Note: Oracle DATE format specifies a datetime up to the second, whereas the sqlserver DATETIME format specifies a datetime up to the millisecond; if that precision is needed, use Oracle's TIMESTAMP instead.
    Note: using an internal representation is risky, implementation details may change. In this case, it seems pretty unlikely that Microsoft will ever change the datetime internal representation, since that would break lots and lots of code.
    Edited by: theoa on 2-jan-2012 9:14

  • How to import sql server database into oracle

    Hi,
    i have a backup of database(complete) from sql server, Is there any way to import that backup database into oracle environment.
    Please let me know the process
    Thanks
    Naren$

    No. You cannot simply import binary data files from a 3rd party database directly into Oracle.
    You can use bcp on SQL-Server to unload the data to CSV and then use Oracle's SQL*Loader to load it.
    You can run a SQL-Server database instance and an Oracle database instance, and use a heterogeneous database link from Oracle (working via ODBC) to connect to SQL-Server - and use SQL statements to pull object definitions and data from SQL-Server into Oracle.

  • DRM export from SQL Server view

    Hi
    We are using v11.1.2.1.
    Is it possible to import master data from a SQL Server view? We only seem to be able to extract from a table.
    Regards

    Yes You can but you have to write sql queries to export in section wise. I mean properties, property categories, node types, validations etc..

  • How can I connect to SQL Server CE?

    Hi!
    How can I connect to SQL Server CE ?
    Any idea?
    I found jdbc driver for SQL Server 6.5,7.0,2000.
    But no driver for SQL CE.
    Thanks for any suggestion....

    I am also searching for same answer.
    I wanna choose Access as a db. but I can't find that so I have a no choice to select SQL2000CE though.
    I am stuck in driver problem. I can't find that.
    Should I use Oracle Lite or PointBase?
    I am under a lot of stress... like you've been...
    I wish you find and post that....

  • Can't Start the SQL Server & SQL Server Agent Services

    Hello i had to make a copy of my setup for a coworker in a different country to work with i can't make this two services to start. A timed out error shows and  maybe the logs say something but i can't understand it. 
    Help Please. 
    2014-10-31 12:18:55.66 Server Microsoft SQL Server 2012 - 11.0.2100.60 (X64)
    Feb 10 2012 19:39:15
    Copyright (c) Microsoft Corporation
    Standard Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1) (Hypervisor)
    2014-10-31 12:18:55.69 Server (c) Microsoft Corporation.
    2014-10-31 12:18:55.69 Server All rights reserved.
    2014-10-31 12:18:55.69 Server Server process ID is 2540.
    2014-10-31 12:18:55.69 Server System Manufacturer: 'VMware, Inc.', System Model: 'VMware Virtual Platform'.
    2014-10-31 12:18:55.69 Server Authentication mode is MIXED.
    2014-10-31 12:18:55.69 Server Logging SQL Server messages in file 'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Log\ERRORLOG'.
    2014-10-31 12:18:55.69 Server The service account is 'NT Service\MSSQLSERVER'. This is an informational message; no user action is required.
    2014-10-31 12:18:55.69 Server Registry startup parameters:
    -d C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\master.mdf
    -e C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Log\ERRORLOG
    -l C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\mastlog.ldf
    2014-10-31 12:18:55.69 Server Command Line Startup Parameters:
    -s "MSSQLSERVER"
    2014-10-31 12:18:56.21 Server SQL Server detected 1 sockets with 2 cores per socket and 2 logical processors per socket, 2 total logical processors; using 2 logical processors based on SQL Server licensing. This is an informational message; no user action is required.
    2014-10-31 12:18:56.21 Server SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required.
    2014-10-31 12:18:56.21 Server Detected 3071 MB of RAM. This is an informational message; no user action is required.
    2014-10-31 12:18:56.21 Server Using conventional memory in the memory manager.
    2014-10-31 12:18:58.04 Server This instance of SQL Server last reported using a process ID of 2532 at 31/10/2014 12:18:20 p.m. (local) 31/10/2014 06:18:20 p.m. (UTC). This is an informational message only; no user action is required.
    2014-10-31 12:18:58.05 Server Node configuration: node 0: CPU mask: 0x0000000000000003:0 Active CPU mask: 0x0000000000000003:0. This message provides a description of the NUMA configuration for this computer. This is an informational message only. No user action is required.
    2014-10-31 12:18:58.07 Server Using dynamic lock allocation. Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node. This is an informational message only. No user action is required.
    2014-10-31 12:18:58.08 Server Software Usage Metrics is disabled.
    2014-10-31 12:18:58.15 spid5s Starting up database 'master'.
    2014-10-31 12:18:58.71 Server CLR version v4.0.30319 loaded.
    2014-10-31 12:18:59.22 spid5s SQL Server Audit is starting the audits. This is an informational message. No user action is required.
    2014-10-31 12:18:59.24 spid5s SQL Server Audit has started the audits. This is an informational message. No user action is required.
    2014-10-31 12:18:59.81 spid5s SQL Trace ID 1 was started by login "sa".
    2014-10-31 12:18:59.98 spid5s Server name is 'WIN-3FNEFF25D4V'. This is an informational message only. No user action is required.
    2014-10-31 12:19:00.76 spid13s A self-generated certificate was successfully loaded for encryption.
    2014-10-31 12:19:00.80 spid13s Server is listening on [ 'any' <ipv6> 1435].
    2014-10-31 12:19:00.80 spid13s Server is listening on [ 'any' <ipv4> 1435].
    2014-10-31 12:19:00.80 spid13s Server is listening on [ 'any' <ipv6> 1433].
    2014-10-31 12:19:00.80 spid13s Server is listening on [ 'any' <ipv4> 1433].
    2014-10-31 12:19:00.80 spid13s Server local connection provider is ready to accept connection on [ \\.\pipe\SQLLocal\MSSQLSERVER ].
    2014-10-31 12:19:00.80 spid13s Server local connection provider is ready to accept connection on [ \\.\pipe\sql\query ].
    2014-10-31 12:19:00.80 Server Server is listening on [ ::1 <ipv6> 1434].
    2014-10-31 12:19:00.80 Server Server is listening on [ 127.0.0.1 <ipv4> 1434].
    2014-10-31 12:19:00.80 Server Dedicated admin connection support was established for listening locally on port 1434.
    2014-10-31 12:19:00.81 Server SQL Server is attempting to register a Service Principal Name (SPN) for the SQL Server service. Kerberos authentication will not be possible until a SPN is registered for the SQL Server service. This is an informational message. No user action is required.
    2014-10-31 12:19:00.81 spid13s SQL Server is now ready for client connections. This is an informational message; no user action is required.
    2014-10-31 12:19:00.81 Server The SQL Server Network Interface library could not register the Service Principal Name (SPN) [ MSSQLSvc/WIN-3FNEFF25D4V ] for the SQL Server service. Windows return code: 0xffffffff, state: 63. Failure to register a SPN might cause integrated authentication to use NTLM instead of Kerberos. This is an informational message. Further action is only required if Kerberos authentication is required by authentication policies and if the SPN has not been manually registered.
    2014-10-31 12:19:00.81 Server The SQL Server Network Interface library could not register the Service Principal Name (SPN) [ MSSQLSvc/WIN-3FNEFF25D4V:1433 ] for the SQL Server service. Windows return code: 0xffffffff, state: 63. Failure to register a SPN might cause integrated authentication to use NTLM instead of Kerberos. This is an informational message. Further action is only required if Kerberos authentication is required by authentication policies and if the SPN has not been manually registered.
    2014-10-31 12:19:00.86 Server Common language runtime (CLR) functionality initialized using CLR version v4.0.30319 from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\.
    2014-10-31 12:19:22.49 spid15s A new instance of the full-text filter daemon host process has been successfully started.
    2014-10-31 12:19:22.68 spid17s Starting up database 'msdb'.
    2014-10-31 12:19:22.69 spid9s Starting up database 'mssqlsystemresource'.
    2014-10-31 12:19:22.69 spid18s Starting up database 'CMOVILBD'.
    2014-10-31 12:19:22.69 spid19s Starting up database 'ArgusTec'.
    2014-10-31 12:19:22.71 spid9s The resource database build version is 11.00.2100. This is an informational message only. No user action is required.
    2014-10-31 12:19:22.90 spid9s Starting up database 'model'.
    2014-10-31 12:19:23.36 spid9s Clearing tempdb database.
    2014-10-31 12:19:23.46 spid9s Starting up database 'tempdb'.
    2014-10-31 12:19:23.67 spid20s The Service Broker endpoint is in disabled or stopped state.
    2014-10-31 12:19:23.67 spid20s The Database Mirroring endpoint is in disabled or stopped state.
    2014-10-31 12:19:23.73 spid20s Service Broker manager has started.
    2014-10-31 12:19:24.67 spid5s Recovery is complete. This is an informational message only. No user action is required.
    2014-11-01 00:00:08.70 spid28s This instance of SQL Server has been using a process ID of 2540 since 31/10/2014 12:19:24 p.m. (local) 31/10/2014 06:19:24 p.m. (UTC). This is an informational message only; no user action is required.
    2014-11-02 00:00:23.48 spid29s This instance of SQL Server has been using a process ID of 2540 since 31/10/2014 12:19:24 p.m. (local) 31/10/2014 06:19:24 p.m. (UTC). This is an informational message only; no user action is required.
    2014-11-03 00:00:53.66 spid29s This instance of SQL Server has been using a process ID of 2540 since 31/10/2014 12:19:24 p.m. (local) 31/10/2014 06:19:24 p.m. (UTC). This is an informational message only; no user action is required.
    2014-11-04 00:00:08.08 spid19s This instance of SQL Server has been using a process ID of 2540 since 31/10/2014 12:19:24 p.m. (local) 31/10/2014 06:19:24 p.m. (UTC). This is an informational message only; no user action is required.
    2014-11-04 18:03:23.74 spid53 Attempting to load library 'xpsqlbot.dll' into memory. This is an informational message only. No user action is required.
    2014-11-04 18:03:23.79 spid53 Using 'xpsqlbot.dll' version '2011.110.2100' to execute extended stored procedure 'xp_qv'. This is an informational message only; no user action is required.
    2014-11-04 18:03:24.72 spid54 Attempting to load library 'xpstar.dll' into memory. This is an informational message only. No user action is required.
    2014-11-04 18:03:24.78 spid54 Using 'xpstar.dll' version '2011.110.2100' to execute extended stored procedure 'xp_instance_regread'. This is an informational message only; no user action is required.
    2014-11-04 18:03:27.74 spid53 Starting up database 'Argus'.
    2014-11-04 18:28:12.10 spid52 Attempting to load library 'xplog70.dll' into memory. This is an informational message only. No user action is required.
    2014-11-04 18:28:12.13 spid52 Using 'xplog70.dll' version '2011.110.2100' to execute extended stored procedure 'xp_msver'. This is an informational message only; no user action is required.
    2014-11-05 00:00:26.82 spid18s This instance of SQL Server has been using a process ID of 2540 since 31/10/2014 12:19:24 p.m. (local) 31/10/2014 06:19:24 p.m. (UTC). This is an informational message only; no user action is required.

    Sorry i feel so stupid. Here it is.  I can clearly see the errors now
    2014-11-05 10:49:47.43 Server Microsoft SQL Server 2008 (SP1) - 10.0.2531.0 (X64)
    Mar 29 2009 10:11:52
    Copyright (c) 1988-2008 Microsoft Corporation
    Express Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1) (VM)
    2014-11-05 10:49:47.43 Server (c) 2005 Microsoft Corporation.
    2014-11-05 10:49:47.43 Server All rights reserved.
    2014-11-05 10:49:47.43 Server Server process ID is 4596.
    2014-11-05 10:49:47.43 Server System Manufacturer: 'VMware, Inc.', System Model: 'VMware Virtual Platform'.
    2014-11-05 10:49:47.43 Server Authentication mode is MIXED.
    2014-11-05 10:49:47.43 Server Logging SQL Server messages in file 'c:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\Log\ERRORLOG'.
    2014-11-05 10:49:47.43 Server This instance of SQL Server last reported using a process ID of 5720 at 05/11/2014 10:28:35 a.m. (local) 05/11/2014 04:28:35 p.m. (UTC). This is an informational message only; no user action is required.
    2014-11-05 10:49:47.43 Server Registry startup parameters:
    -d c:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\master.mdf
    -e c:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\Log\ERRORLOG
    -l c:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\mastlog.ldf
    2014-11-05 10:49:47.44 Server SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required.
    2014-11-05 10:49:47.44 Server Detected 2 CPUs. This is an informational message; no user action is required.
    2014-11-05 10:49:47.46 Server Using dynamic lock allocation. Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node. This is an informational message only. No user action is required.
    2014-11-05 10:49:47.49 Server Node configuration: node 0: CPU mask: 0x0000000000000003 Active CPU mask: 0x0000000000000003. This message provides a description of the NUMA configuration for this computer. This is an informational message only. No user action is required.
    2014-11-05 10:49:47.50 spid7s Starting up database 'master'.
    2014-11-05 10:49:47.59 spid7s FILESTREAM: effective level = 0, configured level = 0, file system access share name = 'SQLEXPRESS'.
    2014-11-05 10:49:47.60 spid7s SQL Trace ID 1 was started by login "sa".
    2014-11-05 10:49:47.60 spid7s Starting up database 'mssqlsystemresource'.
    2014-11-05 10:49:47.61 spid7s The resource database build version is 10.00.2531. This is an informational message only. No user action is required.
    2014-11-05 10:49:47.67 spid7s Server name is 'WIN-3FNEFF25D4V\SQLEXPRESS'. This is an informational message only. No user action is required.
    2014-11-05 10:49:47.67 spid10s Starting up database 'model'.
    2014-11-05 10:49:47.68 spid7s Informational: No full-text supported languages found.
    2014-11-05 10:49:47.68 spid7s Starting up database 'msdb'.
    2014-11-05 10:49:47.76 spid10s Clearing tempdb database.
    2014-11-05 10:49:47.83 Server A self-generated certificate was successfully loaded for encryption.
    2014-11-05 10:49:47.83 Server Error: 26023, Severity: 16, State: 1.
    2014-11-05 10:49:47.83 Server Server TCP provider failed to listen on [ 'any' <ipv6> 1433]. Tcp port is already in use.
    2014-11-05 10:49:47.83 Server Error: 17182, Severity: 16, State: 1.
    2014-11-05 10:49:47.83 Server TDSSNIClient initialization failed with error 0x2740, status code 0xa. Reason: Unable to initialize the TCP/IP listener.
    2014-11-05 10:49:47.83 Server Error: 17182, Severity: 16, State: 1.
    2014-11-05 10:49:47.83 Server TDSSNIClient initialization failed with error 0x2740, status code 0x1. Reason: Initialization failed with an infrastructure error. Check for previous errors.
    2014-11-05 10:49:47.83 Server Error: 17826, Severity: 18, State: 3.
    2014-11-05 10:49:47.83 Server Could not start the network library because of an internal error in the network library. To determine the cause, review the errors immediately preceding this one in the error log.
    2014-11-05 10:49:47.83 Server Error: 17120, Severity: 16, State: 1.
    2014-11-05 10:49:47.83 Server SQL Server could not spawn FRunCM thread. Check the SQL Server error log and the Windows event logs for information about possible related problems.

  • Can I use Microsoft SQL Server Management Studio version 11.0 to write SQL queries for "SQL Server Compact 4.0 Local Database"

    Hi, Can I use Microsoft SQL Server Management Studio version 11.0 to write SQL queries for "SQL Server Compact 4.0 Local Database" ?
    When I use Connect Object Explorer, the "Connect to Server" dialog box which pops up has only 4 selections in the Server Type Drop Down List. They are Database Engine, Analysis Services, Reporting Services & Integration Services. I have read
    somewhere that there should be a compact database option. but I do not see it.
    What I would like to do is use free form SQL Queries against the tables in "SQL Server Compact 4.0 Local Database" .
    Once I have validated these queries, then I will use them in my Visual Studio 2012 C#, ASP.NET application. I created the Local Database using Visual Studio 2012 for use by my application.
    Thank you for your help..
    diana4

    Hello,
    With SSMS 2005 we have had the Option to work with SQL CE database files, but not with higher Version of SSMS.
    You can use the free SQL CE Toolbax instead; see
    http://sqlcetoolbox.codeplex.com/
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • Where can I find a sql server 2000 driver which supports JDBC 2.0?

    Where can I find a sql server 2000 driver which supports JDBC 2.0?
    Thanks!
    Paul.

    Here is another.
    http://www.datadirect-technologies.com/download/downloadindex.asp
    The JDBC 3.0 driver will work in a JDBC 2.0 environment (i.e with J2SE 1.2 or 1.3)
    provided you use only JDBC 2.0 features of the driver
    "Sree Bodapati" <[email protected]> wrote:
    >
    >
    http://msdn.microsoft.com/downloads/default.asp?URL=/downloads/sample.asp?ur
    l=/msdn-files/027/001/779/msdncompositedoc.xml&FinishURL=%2Fdownloads%2Frele
    ase%2Easp%3FReleaseID%3D38312%26area%3Dsearch%26ordinal%3D1%26redirect%3Dno
    Microsoft.com downloads :)
    http://www.inetsoftware.de/English/Produkte/JDBC_Overview/ms.htm
    www.inetsoftware.de
    are a couple.
    sree
    "pronane" <[email protected]> wrote in message
    news:[email protected]..
    Where can I find a sql server 2000 driver which supports JDBC 2.0?
    Thanks!
    Paul.

  • Can't connect  to SQL Server 2000 from serlet

    Hi,
    I can connect to SQL Server 2000 from standalone program after set the classpath properly.
    but I Can't connect to SQL Server 2000 from serlet, I am using Tomcat 4.1 and Win2K pro now. Do I need to set something for servlet just like CLASSPATH?
    Any help will be appreciated.
    package usingjsp;
    import java.io.*;
    import java.sql.*;
    import javax.servlet.*;
    public class JDBCServlet extends GenericServlet
    protected Connection conn;
    public void init()
    try
    // Make sure the JdbcOdbcDriver class is loaded
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
    // Try to connect to a database via ODBC
    conn = DriverManager.getConnection(
    "jdbc:microsoft:sqlserver://hu:1433", "sa","");
    catch (Exception exc)
    // If there's an error, use the servlet logging API
    getServletContext().log(
    "Error making JDBC connection: ", exc);
    public void service(ServletRequest request, ServletResponse response)
    throws java.io.IOException
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    out.println("<HTML>");
    out.println("<BODY>");
    out.println("<PRE>");
    out.println("The JDBC connection is:");
    out.println(conn);
    out.println("</PRE>");
    out.println("</BODY>");
    out.println("</HTML>");

    i also have this problem..do u have any solution?

  • Can't connect to SQL Server

    Can't connect to SQL Server while filling the RIGHT Server name (with Windows authentication).
    When i try to start SQL Server (SQLExpress) service from SQL Server Configuration manager, i get following error:

    Hello,
    Just as the error message prompt: please review the Event log, it should indicate more details about the cause of the issue.
    The following blog is about the similar issue which caused by the services account, you can take as reference to troubleshoot the problem:
    http://blog.sqlauthority.com/2011/03/29/sql-server-fix-error-the-request-failed-or-the-service-did-not-respond-in-timely-fashion-consult-the-event-log-or-other-applicable-error-logs-for-details/
    Regards,
    Fanny Liu
    If you have any feedback on our support, please click here. 
    Fanny Liu
    TechNet Community Support

  • Can we use SQL Server as a primary data storage for SharePoint 2013?

    Is it possible to use external SQL Server as a primary data storage for SharePoint 2013?
    Having this implemented we can generate reports, query data and it would become very very powerful to use.
    Or
    Is there a way to keep on using existing content databases and using external SQL Server as a secondary data storage at the same time. So I want it to be like redundant data in SQL Server.
    Thanks 

    Hi,
    Not sure if I understand your question correctly, SharePoint has its own content database storing SharePoint list data, we can use SSRS/SSAS integated with SharePoint mode to use sharepoint list as datasource to generate reports.
    http://technet.microsoft.com/en-us/library/bb326358(v=sql.105).aspx
    http://sqlmag.com/business-intelligence/delivering-bi-through-sql-server-and-sharepoint
    http://www.mssqltips.com/sqlservertip/2068/using-a-sharepoint-list-as-a-data-source-in-sql-server-reporting-services-2008-r2/
    Thanks
    Daniel Yang
    TechNet Community Support

  • How many users from an application can connect to a SQL server at a time?

    HI,
        I need to know , How many users from an application can connect to a SQL server at a time? Do we have any settings for this in SQL server for limiting the users?

    This is a difficult question, since it is both technical and legal.
    The absolute maximum number of connections is around 32700, but unless your server is very beefy, it will choke long before that. A connection is not a user - an application can have many connections for the same user. Depending on your license
    model, you may be legally limited to a certain number of users, but this number is not enforced technially.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • How can i run Following SQL Server Script in to Oracle 10g

    I m new in Oracle...
    Create Procedure Insert_profilebasicdetail
    @isubprofileid as int,
    @Copyisubprofileid as int,
    @itranno as int,
    As
    Begin
    Declare @IncKeyId as int
    Declare @tempkeyId as int
    set @IncKeyId=(select isNull(Max(ikeyId),0)as MaxKeyId from profilebasicdetail)
    Declare TempInsert cursor for select ikeyId--,iprofileid,iquestionid,vquestionans,cstatusindi,dmodifyon,imodifyby,iyear
    from profilebasicdetail where isubprofileid=@Copyisubprofileid and itranno=@itranno
    open TempInsert
    fetch from TempInsert into @tempkeyId
    while @@fetch_Status=0
    Begin
    set @IncKeyId = @IncKeyId + 1
    Insert into profilebasicdetail
    (ikeyid,iprofileid,iquestionid,vquestionans,cstatusindi,dmodifyon,imodifyby,itranno,iyear,isubprofileid)
    values(select @IncKeyId,iprofileid,iquestionid,vquestionans,cstatusindi,dmodifyon,imodifyby,'1',
    iyear,@isubprofileid from profilebasicdetail where ikeyId=@tempkeyId)
    fetch next from TempInsert into @tempkeyId
    End
    End
    Regards,
    Ajay

    YOu want to migrate your MS sql server procedure to Oracle procedure
    Before running procedure please set the values of tempkeyId_v variable
    Try this
    Create or replace Procedure Insert_profilebasicdetail( isubprofileid_v  number, Copyisubprofileid_v number, itranno_v number )
    As
         IncKeyId_v  profilebasicdetail.ikeyid%type;
         tempkeyId_v profilebasicdetail.ikeyid%type;
    begin
          select nvl((select Max(ikeyId) as MaxKeyId from profilebasicdetail),0) into IncKeyId_v
          from dual ;
         for i in (select ikeyId--,iprofileid,iquestionid,vquestionans,cstatusindi,dmodifyon,imodifyby,iyear
                from profilebasicdetail
                where isubprofileid=Copyisubprofileid_v and itranno=itranno_v)
         loop
              IncKeyId_v = IncKeyId_v + 1;
              Insert into profilebasicdetail
                   (ikeyid,iprofileid,iquestionid,vquestionans,cstatusindi,dmodifyon,imodifyby,itranno,iyear,isubprofileid)
                   values(select IncKeyId_v,i.iprofileid,i.iquestionid,i.vquestionans,i.cstatusindi,i.dmodifyon,i.imodifyby,'1',
                        i.iyear,isubprofileid_v from profilebasicdetail where ikeyId=tempkeyId_v);
         end loop
    End;
    / Regards
    Singh
    Create or replace Procedure Insert_profilebasicdetail( isubprofileid_v  number, Copyisubprofileid_v number, itranno_v number )
    As
         IncKeyId_v  profilebasicdetail.ikeyid%type;
         tempkeyId_v profilebasicdetail.ikeyid%type;
    begin
          select nvl((select Max(ikeyId) as MaxKeyId from profilebasicdetail),0) into IncKeyId_v
          from dual ;
         for i in (select ikeyId--,iprofileid,iquestionid,vquestionans,cstatusindi,dmodifyon,imodifyby,iyear
                from profilebasicdetail
                where isubprofileid=Copyisubprofileid_v and itranno=itranno_v)
         loop
              IncKeyId_v = IncKeyId_v + 1;
              Insert into profilebasicdetail
                   (ikeyid,iprofileid,iquestionid,vquestionans,cstatusindi,dmodifyon,imodifyby,itranno,iyear,isubprofileid)
                   values(select IncKeyId_v,i.iprofileid,i.iquestionid,i.vquestionans,i.cstatusindi,i.dmodifyon,i.imodifyby,'1',
                        i.iyear,isubprofileid_v from profilebasicdetail where ikeyId=tempkeyId_v);
         end loop
    End;
    / Regards
    Singh

  • Problem in Loading Data from SQL Server 2000 to Oracle 10g

    Hi All,
    I am a university student and using ODI for my final project on real-time data warehousing. I am trying to load data from MS SQL Server 2000 into Oracle 10g target table. Everything goes fine until I execute the interface for the initial load. When I choose the CKM Oracle(Create unique index on the I$ table) km, the following step fails:
    21 - Integration - Prj_Dim_RegionInterface - Create Unique Index on flow table
    Where Prj_Dim_Region is the name of my target table in Oracle.
    The error message is:
    955 : 42000 : java.sql.SQLException: ORA-00955: name is already used by an existing object
    java.sql.SQLException: ORA-00955: name is already used by an existing object
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:316)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:282)
         at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:639)
         at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:185)
         at oracle.jdbc.driver.T4CPreparedStatement.execute_for_rows(T4CPreparedStatement.java:633)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1086)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2984)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3057)
         at com.sunopsis.sql.SnpsQuery.executeUpdate(SnpsQuery.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execStdOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlI.treatTaskTrt(SnpSessTaskSqlI.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
         at com.sunopsis.dwg.cmd.e.i(e.java)
         at com.sunopsis.dwg.cmd.g.y(g.java)
         at com.sunopsis.dwg.cmd.e.run(e.java)
         at java.lang.Thread.run(Unknown Source)
    I am using a surrogate key column in my target table alongwith the natural key. The natural key is populated by the primary key of my source table, but for the surrogate key, I have created a sequence in my oracle schema where the target table exists and have used the following code for mapping:
    <%=snpRef.getObjectName( "L" , "SQ_PRJ_DIM_REGION" , "D" )%>.nextval
    I have chosen to execute this code on target.
    Among my attempts to solve this problem was to set Create Index option of the CKM Oracle(Create Index for the I$ Table) to No so that it wont create any index on the flow table. I also tried to use the simple CKM Oracle km . Both solutions allowed the interface to execute successfully without any errors, but the data was not loaded into the target table.
    When I right-click on the Prj_Dim_Region data store and choose Data, it shows empty. Pressing the SQL button in this data store shows a dialog box " New Query" where I see this query:
    select * from NOVELTYFURNITUREDW.PRJ_DIM_REGION
    But when i press OK to run it, I get this error message:
    java.lang.IllegalArgumentException: Row index out of range
         at javax.swing.JTable.boundRow(Unknown Source)
         at javax.swing.JTable.setRowSelectionInterval(Unknown Source)
         at com.borland.dbswing.JdbTable.accessChange(JdbTable.java:2959)
         at com.borland.dx.dataset.AccessEvent.dispatch(Unknown Source)
         at com.borland.jb.util.EventMulticaster.dispatch(Unknown Source)
         at com.borland.dx.dataset.DataSet.a(Unknown Source)
         at com.borland.dx.dataset.DataSet.a(Unknown Source)
         at com.borland.dx.dataset.DataSet.a(Unknown Source)
         at com.borland.dx.dataset.DataSet.open(Unknown Source)
         at com.borland.dx.dataset.StorageDataSet.refresh(Unknown Source)
         at com.borland.dx.sql.dataset.QueryDataSet.refresh(Unknown Source)
         at com.borland.dx.sql.dataset.QueryDataSet.executeQuery(Unknown Source)
         at com.sunopsis.graphical.frame.a.cg.actionPerformed(cg.java)
         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
         at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
         at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Window.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    I do not understand what the problem is and wasting days to figure it out. Any help will be highly appreciated as my deadline is too close for this project.
    Thank you so much in advance.
    Neel

    Hi Cezar,
    Can u plz help me with this scenario?
    I have one Oracle data model with 19 source tables and one SQL Server data model with 10 target tables. I have created 10 interfaces which use JournalizedDataOnly on one of the tables in the interface; e.g in interface for DimCustomer target table, I have 2 tables, namely Customer and Address, but the journalizing filter appear only on Customer table and this option is disabled for Address automatically.
    Now I want to create a package using OdiWaitForLog event detection. Is it possible to put all these 10 interfaces in just one package to populate the target tables? It works fine when I have only one interface and I use the name of one table in the interface for Table Name parameter of OdiWaitForLogData event, but when I try a comma seperated list of table names[Customer, Address] this error happens
    java.sql.SQLException: ORA-00942: table or view does not exist
    and if I use this method <%=odiRef.getObjectName("L","model_code","logical_schema","D")%>, I get this error
    "-CDC_SET_NAME=Exception getObjectName("L", "model_code", "logical_schema", "D") : SnpLSchema.getLSchemaByName : SnpLschema does not exist" "
    Please let me know how to make it work?
    Do I need to create separate data models each including only those tables which appear in their corresponding interface and package? Or do I need to create multiple packages each with only one journalized interface to populate only one target table?
    Thank you for your time in advance.
    Regards,
    Neel

  • Reg. Migrating data from SQL Server 2000 to Oracle

    Hi All,
    I need to migrate a same data from SQL Server 2000 to Oracle 9i.In sql server Export option is there, but the problem is some 30 tables have More than one LONG datatype column in a table. That's why oracle not allow to import.
    Could you guys find any tool for the same.
    Please do the needful.
    Thanks & Regards,
    Prathap

    hi dermot,
    it's very urgent now. Can you please give any solution for this.
    and also i tried the SQL developer tool. But i got an below error,
    Error starting at line 2 in command:
    CREATE USER dbo_testdatalatest IDENTIFIED BY dbo_testdatalatest DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE TEMP
    Error at Command Line:2 Column:45
    Error report:
    SQL Error: ORA-01031: insufficient privileges
    01031. 00000 - "insufficient privileges"
    *Cause:    An attempt was made to change the current username or password
    without the appropriate privilege. This error also occurs if
    attempting to install a database without the necessary operating
    system privileges.
    When Trusted Oracle is configure in DBMS MAC, this error may occur
    if the user was granted the necessary privilege at a higher label
    than the current login.
    *Action:   Ask the database administrator to perform the operation or grant
    the required privileges.
    For Trusted Oracle users getting this error although granted the
    the appropriate privilege at a higher label, ask the database
    administrator to regrant the privilege at the appropriate label.
    Error starting at line 3 in command:
    GRANT CREATE SESSION, RESOURCE, CREATE VIEW TO dbo_testdatalatest
    Error report:
    SQL Error: ORA-01031: insufficient privileges
    01031. 00000 - "insufficient privileges"
    *Cause:    An attempt was made to change the current username or password
    without the appropriate privilege. This error also occurs if
    attempting to install a database without the necessary operating
    system privileges.
    When Trusted Oracle is configure in DBMS MAC, this error may occur
    if the user was granted the necessary privilege at a higher label
    than the current login.
    *Action:   Ask the database administrator to perform the operation or grant
    the required privileges.
    For Trusted Oracle users getting this error although granted the
    the appropriate privilege at a higher label, ask the database
    administrator to regrant the privilege at the appropriate label.
    Error starting at line 4 in command:
    CREATE USER epm_testdatalatest IDENTIFIED BY epm_testdatalatest DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE TEMP
    Error at Command Line:4 Column:45
    Error report:
    SQL Error: ORA-01031: insufficient privileges
    01031. 00000 - "insufficient privileges"
    *Cause:    An attempt was made to change the current username or password
    without the appropriate privilege. This error also occurs if
    attempting to install a database without the necessary operating
    system privileges.
    When Trusted Oracle is configure in DBMS MAC, this error may occur
    if the user was granted the necessary privilege at a higher label
    than the current login.
    *Action:   Ask the database administrator to perform the operation or grant
    the required privileges.
    For Trusted Oracle users getting this error although granted the
    the appropriate privilege at a higher label, ask the database
    administrator to regrant the privilege at the appropriate label.
    Error starting at line 5 in command:
    GRANT CREATE SESSION, RESOURCE, CREATE VIEW TO epm_testdatalatest
    Error report:
    SQL Error: ORA-01031: insufficient privileges
    01031. 00000 - "insufficient privileges"
    *Cause:    An attempt was made to change the current username or password
    without the appropriate privilege. This error also occurs if
    attempting to install a database without the necessary operating
    system privileges.
    When Trusted Oracle is configure in DBMS MAC, this error may occur
    if the user was granted the necessary privilege at a higher label
    than the current login.
    *Action:   Ask the database administrator to perform the operation or grant
    the required privileges.
    For Trusted Oracle users getting this error although granted the
    the appropriate privilege at a higher label, ask the database
    administrator to regrant the privilege at the appropriate label.
    Error starting at line 6 in command:
    CREATE USER lportal_testdatalatest IDENTIFIED BY lportal_testdatalatest DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE TEMP
    Error at Command Line:6 Column:49
    Error report:
    SQL Error: ORA-01031: insufficient privileges
    01031. 00000 - "insufficient privileges"
    *Cause:    An attempt was made to change the current username or password
    without the appropriate privilege. This error also occurs if
    attempting to install a database without the necessary operating
    system privileges.
    When Trusted Oracle is configure in DBMS MAC, this error may occur
    if the user was granted the necessary privilege at a higher label
    than the current login.
    *Action:   Ask the database administrator to perform the operation or grant
    the required privileges.
    For Trusted Oracle users getting this error although granted the
    the appropriate privilege at a higher label, ask the database
    administrator to regrant the privilege at the appropriate label.
    Error starting at line 7 in command:
    GRANT CREATE SESSION, RESOURCE, CREATE VIEW TO lportal_testdatalatest
    Error report:
    SQL Error: ORA-01031: insufficient privileges
    01031. 00000 - "insufficient privileges"
    *Cause:    An attempt was made to change the current username or password
    without the appropriate privilege. This error also occurs if
    attempting to install a database without the necessary operating
    system privileges.
    When Trusted Oracle is configure in DBMS MAC, this error may occur
    if the user was granted the necessary privilege at a higher label
    than the current login.
    *Action:   Ask the database administrator to perform the operation or grant
    the required privileges.
    For Trusted Oracle users getting this error although granted the
    the appropriate privilege at a higher label, ask the database
    administrator to regrant the privilege at the appropriate label.
    Error starting at line 8 in command:
    connect dbo_testdatalatest/dbo_testdatalatest;
    Error report:
    Connection Failed
    Commit
    Regards,
    Prathap.R

Maybe you are looking for

  • How do I get QuickTime .mov files transferred from my Mac onto my PC to play?

    I recently transferred a bunch of QuickTime videos from my Mac to my PC using an external hard drive. When I tried to open to files on my PC, the files were recognized as QuickTime files but they would not play. It said the files were of a type that

  • Mail forwarding question

    Hello, I have added mail forwarding throguh delegated admin for a user. The issue I am observing is the mail box which has forwarder entry also has emails and they are not getting deleted. My question is whether can I set something where in the messa

  • Can't installed on Macintosh HD because Mac OS x version 10.9 or later is required

    I tried to download iPhoto app on this mac pro but it come pop say "We could not complete your purchase" iPhoto cant be installed on "Macintosh HD" because Mac OS X version 10.9 or later is required.. ??????  I already update version but still wont o

  • Can't open png in cs4

    hi there, after instaling ps cs4 me 11, i couldn't open png file... i'm using win7 64 bit help pls

  • When can we get blog integration?!

    I feel like even if we had a Tumblr or Blogger widget, it would be an added feature we could offer clients. Thoughts?