Results 1 to 5 of 5

Thread: DTS and Oracle

  1. #1
    Join Date
    Jan 2003
    Posts
    41

    Unanswered: DTS and Oracle

    I want to import a table called emp(user name scott/tiger) from oracle database to MSSQL database

    Step 1
    login to scott/tiger in oracle

    Step 2
    Create a table called emp

    create table emp (empno int, empname varchar(20))

    Step 3
    insert into emp (empno, empname)
    values(1,'aaa')

    insert into emp (empno, empname)
    values(2,'bbb')

    insert into emp (empno, empname)
    values(3,'ccc')

    Step 4
    Now I want to import this table to mssql using DTS.

    I have used Data Transmission task in DTS for source query. I have given "select * from scott.emp"

    I am able to get the exact result set. I am able to get the same values in MSSQL.

    Step 5
    Now I am creating another user called "test" and give access to "emp" table of "scott" user.

    Step 6
    Now i want to pass on "test" instead of "scott" in the Data Transmission Task.(i.e).
    "SELECT * FROM test.emp" instead of "scott.test". I want to pass "test" dynamically.

    how to do this.

  2. #2
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    use a linked server to oracle.

    create a stored proc with dynamic sql.

    pass the table owner as a paramter to the stored procedure.
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  3. #3
    Join Date
    Jan 2003
    Posts
    41

    I dont have permissions for creating stored procedures

    Hi
    I have given you only a sample. I dont have permissions to create tables or create stored procedures. I have only permissions for select statement.

    Thanks

    Quote Originally Posted by jtamil2001
    I want to import a table called emp(user name scott/tiger) from oracle database to MSSQL database

    Step 1
    login to scott/tiger in oracle

    Step 2
    Create a table called emp

    create table emp (empno int, empname varchar(20))

    Step 3
    insert into emp (empno, empname)
    values(1,'aaa')

    insert into emp (empno, empname)
    values(2,'bbb')

    insert into emp (empno, empname)
    values(3,'ccc')

    Step 4
    Now I want to import this table to mssql using DTS.

    I have used Data Transmission task in DTS for source query. I have given "select * from scott.emp"

    I am able to get the exact result set. I am able to get the same values in MSSQL.

    Step 5
    Now I am creating another user called "test" and give access to "emp" table of "scott" user.

    Step 6
    Now i want to pass on "test" instead of "scott" in the Data Transmission Task.(i.e).
    "SELECT * FROM test.emp" instead of "scott.test". I want to pass "test" dynamically.

    how to do this.

  4. #4
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    how are you going to step 2 without create table permissions?
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  5. #5
    Join Date
    Dec 2002
    Posts
    1,245
    Quote Originally Posted by jtamil2001
    Hi
    I have given you only a sample. I dont have permissions to create tables or create stored procedures. I have only permissions for select statement.

    Thanks
    I think Thras meant to create the stored procedures on the SQL Server side.

    Regards,

    hmscott
    Last edited by hmscott; 01-17-06 at 09:47.
    Have you hugged your backup today?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •