Home > SQL Server Tips > Database Administrator > Lessons Learned: Working with Oracle stored procedures, applications and data
SQL Server Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

DATABASE ADMINISTRATOR

Lessons Learned: Working with Oracle stored procedures, applications and data


SearchSQLServer.com editors
09.14.2005
Rating: --- (out of 5)


Expert advice on database administration
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


Working with both Oracle and SQL Server databases presents a variety of challenges -- precisely why we've compiled this collection of short lessons by Kevin Kline, our resident Monitoring/Administration expert. If you have questions about working with Oracle and SQL Server, submit them today.

Kevin Kline
Your Instructor: Kevin Kline, Monitoring/Administration Expert
Kline is director of SQL Server Solutions at Quest Software and president of the international Professional Association for SQL Server (PASS). Here he addresses the following topics:

   Executing an Oracle stored procedure on SQL Server
   Connecting an Oracle application to SQL Server
   Importing data from other databases to SQL Server

  Executing an Oracle stored procedure on SQL Server Return to Table of Contents

Question: Is it possible to execute an Oracle stored procedure on SQL Server? If so, how?

Kline: Oracle uses its own dialect of SQL called PL/SQL (procedural language extension to Structured Query Language), while SQL Server uses T-SQL (Transact-SQL). The two have very different rules about variables, parameters, conditional processing, error handling and so forth. So unless the Oracle stored procedure contains only ANSI SQL statements, it won't work on SQL Server. However, Microsoft recently introduced a new tool that aids in the migration process from Oracle to SQL Server. You should investigate the SQL Server Migration Assistant. You should also note that moving from Oracle to SQL Server is not considered a simple point-n-click process. It usually involves a healthy dose of planning, analysis and good ol' fashion elbow grease.

Click for the original question and response.

  Connecting an Oracle application to SQL Server Return to Table of Contents

Question: I am currently working on a project with Oracle9i Forms at the front end and Microsoft SQL Server at the back end. What steps should I take to connect an Oracle9i Forms application with a SQL Server database?

Kline: I can't think of an easy way off of the top of my head. There's the Oracle Transparent Gateway. But that is certainly not an easy approach. There are also a few tools available using Oracle's Migration Workbench. You may also be able to connect using a JDBC driver. Check out Microsoft's JDBC driver for SQL Server. You can also find a list of JDBC drivers at DevX.com.

Click for the original question and response.

  Importing data from other databases to SQL Server Return to Table of Contents

Question: Can a stored procedure be used to import data from other types of databases and text files to SQL Server?

Kline: Absolutely! I've written many stored procedures to import data from other servers, usually Oracle and Access as well as from text files. When importing data from other servers, you'll have an easier time if you set up the source server as a Linked Server (see SQL Server Books Online for more details).

Once you've set up the Linked Server, you can write SQL statements directly against the Linked Server. For example, you could write the statement INSERT INTO local_table…SELECT col1, col2,… FROM linked_server.db1.dbo.foo.

When importing data from text files, simply use the BULK INSERT statement or, my preference, call the BCP command line utility using XP_CMDSHELL within the stored procedure. It takes a little work to get the exact XP_CMDSHELL string correct. All you have to do is encapsulate the BCP command-line string within a parameter for XP_CMDSHELL extended stored procedure.

Click for the original question and response.


More information from SearchSQLServer.com

  • Ask the Experts: Understand the differences between the bitmap index in Oracle vs. SQL Server 2005
  • Ask the Experts: View all of Kevin Kline's questions and answers
  • Article: Check out this Oracle vs. SQL Server face-off, from 2004


  • Rate this Tip
    To rate tips, you must be a member of SearchSQLServer.com.
    Register now to start rating these tips. Log in if you are already a member.




    Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


    RELATED CONTENT
    SQL Server integration/interoperability
    How to create a SQL Server linked server to DB2
    Top 10 SQL Server Integration Services (SSIS) and DTS tips
    Export SQL Server data to an Excel file using SSIS and Visual Studio
    Performance tuning for SQL Server 2005 and Exchange running on SBS
    Custom VB.Net scripting in SQL Server Integration Services
    Can SQL Server 2000 work on Windows 2003 platform?
    Query to search text in old DTS packages in SQL Server?
    Handle slowly changing dimensions with SSIS 2005 wizard
    Run DTS packages within SQL Server Integration Services
    SQL Server Blog Watch

    SQL Server stored procedures
    SQL and SQL Server Tutorial and Reference Guide
    SQL Server stored procedures tutorial: Write, tune and get examples
    Check SQL Server database and log file size with this stored procedure
    SQL Server source code analysis and management adds database security
    Configure SQL Server Service Broker for sending stored procedure data
    Find size of SQL Server tables and other objects with stored procedure
    Track changes to SQL Server 2000 and 2005 with one simple utility
    Troubleshoot SQL Server 2005 temporary table performance problems
    Use SQL Profiler to find long running stored procedures and commands
    Stored procedure to monitor long-running jobs in SQL Server 2000

    SQL Server overview
    Tuning SQL Server performance via disk arrays and disk partitioning
    Should you upgrade to SQL Server 2005 or SQL Server 2008?
    SQL Server data conversions from date/time values to character types
    Using full-text search for symbols in SQL Server
    SQL and SQL Server Tutorial and Reference Guide
    How to use the SELECT statement in SQL
    Translating information requests into SQL SELECT statements
    SQL SELECT statement and SELECT query samples
    Using the ORDER BY clause of the SELECT query in SQL
    Using DISTINCT in SQL to eliminate duplicate rows
    SQL Server overview Research

    RELATED GLOSSARY TERMS
    Terms from Whatis.com − the technology online dictionary
    CORBA  (SearchSQLServer.com)

    RELATED RESOURCES
    2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
    Search Bitpipe.com for the latest white papers and business webcasts
    Whatis.com, the online computer dictionary

    DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.

    HomeNewsTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersIT Downloads
    About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
    SEARCH 
    TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

    TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




    All Rights Reserved, Copyright 2005 - 2008, TechTarget | Read our Privacy Policy
      TechTarget - The IT Media ROI Experts