Droping a schema in the DB

  • I have a schema Sch1 in the DB. This schema is the owner for 4 data base tables. So if I delete the schema do the objects will also be droppped?

    In that case can I change the ownership of the objects and then drop the schema?

    Thanks.

  • Check out the Alter Schema command in Books Online. That should give you what you need.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • Right now all the database objects are owned by the schema produser. I need to make the change so that these objects should be owned by dbo.

    Can I achieve this by using the following command.

    ALTER SCHEMA produser TRANSFER dbo

    Right now I am querying my table by using the following select command.

    SELECT * FROM produser.tbl1

    I need to select the table with the following syntax.

    SELECT * FROM tbl1

  • To move the produser schema to dbo you will need to run the query ALTER SCHEMA

    For the example above use

    ALTER SCHEMA dbo TRANSFER produser.tbl1

    Now you will be able to run the query SELECT * FROM tbl1

  • Thank you so much.

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

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