how to change new schema name from existing schema - Table

  • Hi,

    I want change schema name on Table.

    hwdata.DesktopSoft_Master

    to change

    dbo.DesktopSoft_Master

    I tried as below

    ALTER SCHEMA HWData TRANSFER dbo.DesktopSoft_Master;

    Error-

    Msg 15530, Level 16, State 1, Line 1

    The object with name "DesktopSoft_Master" already exists.

    Can you give me script for change new schema Object.

    Thanks

  • that error says the table already exists in the hwdata schema.

    do a quick

    select * from hwdata.DesktopSoft_Master

    select * from dbo.DesktopSoft_Master

    decide which one to keep (say dbo was the "good one"

    then drop table hwdata.DesktopSoft_Master

    and try to transfer again.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • This was removed by the editor as SPAM

  • There are no such object in the destination schema, must be something else.

    • This reply was modified 4 years, 3 months ago by  clin27.
  • ALTER SCHEMA [dbo] TRANSFER HWData.DesktopSoft_Master;

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply