Develop a queryy...

  • Hey guys,

    hwz it goin...

    Here is a small question about, how to write a query so that i can change the name of the "Schema" as DBO. to my deisred schema name?

    Assume i have a database named 'StudentDetails'.

    i want to rename all the tables/objects in my database from DBO.

    by writing a sql query not by using GUI interface or by any other options..

    Any help would b really appreciable..

    Thank you

  • ashy4blue (2/10/2009)


    Here is a small question about, how to write a query so that i can change the name of the "Schema" as DBO. to my deisred schema name?

    Why do you want to change the name of the schema?

    I suspect (but haven't tried) that dbo can't be renamed. You can add a different schema and move the tables. Looks up ALTER SCHEMA in Books Online for details

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • dbo is a system schema. It can't be changed. You just need to add a schema and then make it the default.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

Viewing 3 posts - 1 through 2 (of 2 total)

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