Change Default owner 'Username' to 'dbo'

  • Hello friends,

    I have created a database with name caspa_in_caspa that is associaded with a user caspa_in_caspabareilly and

    when we are creating table in database caspa_in_caspa though query it is created as caspa_in_caspa.tablename but we want it should be dbo. tablename. plz resolve it asap..

    Sir We are executing following query:

    create table ttt

    (id int)

    table created as:caspa_in_caspabareilly.ttt(That is not required)

    table should be created as:dbo.ttt(That is required)

    Note::This will create like:caspa_in_caspabareilly.ttt that is username.tablename

    but we want to create table like dbo.table name

    we are waiting for your reply..

    Thanks..

  • look up this article

    http://msdn.microsoft.com/en-us/library/aa259622%28v=sql.80%29.aspx

    Jayanth Kurup[/url]

  • [font="Times New Roman"]

    Hi,

    You may try something like:

    CREATE TRABLE dbo.tblName (id INT)

    Regrads,

    Anil

    [/font]

  • shubham.saxena67 (7/8/2011)


    Hello friends,

    I have created a database with name caspa_in_caspa that is associaded with a user caspa_in_caspabareilly and

    when we are creating table in database caspa_in_caspa though query it is created as caspa_in_caspa.tablename but we want it should be dbo. tablename. plz resolve it asap..

    Sir We are executing following query:

    create table ttt

    (id int)

    table created as:caspa_in_caspabareilly.ttt(That is not required)

    table should be created as:dbo.ttt(That is required)

    Note::This will create like:caspa_in_caspabareilly.ttt that is username.tablename

    but we want to create table like dbo.table name

    we are waiting for your reply..

    Thanks..

    When executing a CREATE TABLE where the table name is not schema-qualified SQL Server opts to create the table in the database user's default schema.

    You can change the default schema for any database user to dbo (or anything you like) with an ALTER USER statement like this:

    ALTER USER user_name WITH DEFAULT_SCHEMA = dbo;

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • Hi Friend,

    You Are Great you completely understand my problem

    and you have fully solved the issue.

    I am so much thankful to you to spent your valuable time to solve my query.

    T

    H

    A

    N

    K

    S

    A LOT.

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

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