Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2011
    Posts
    3

    Unanswered: Copy objects from one schema to another schema

    Hi,

    I am new to Sql server. I am using sql server 2008 R2.
    I want to copy all the objects of one schema and put it in another schema. I want to do that from command prompt.
    In oracle we can export the objects of one user and import to another user using exp and imp. I want similar type.
    Can anyone suggest me a way to do this?


    Thanks,
    Hariharan

  2. #2
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    In SQL Server, you can move objects from one schema to another with the system procedure sp_changeobjectowner. To copy them, you can generate a script of the objects from SQL Server Management Studio, and do a search and replace of the schema name on the resulting text file. This may of course catch references to objects inside view and/or stored procedure definitions.

  3. #3
    Join Date
    Nov 2011
    Posts
    3
    Hi MCrowley,

    Thanks for your reply.
    I do not want to move the objects between schema, but i need to copy. I want to do that from command prompt not from the SQL Server Management Studio.

  4. #4
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    There may be options for that in the Visual Studio 2010 database synchronization tools, but I do not use VS 2010 at all. Once a set of options has been saved, it can run on a scheduled basis (I imagine as a script, but again, I could be wrong). Check to see if any of your developers have it installed.

  5. #5
    Join Date
    Oct 2011
    Posts
    29
    this may help you!!!

    Copy One Schema to Another Schema

  6. #6
    Join Date
    Nov 2011
    Posts
    3
    Hi sqlserverdba1,

    Thanks for your reply.
    How to do that for all the objects inside a schema?

Tags for this Thread

Posting Permissions

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