View Name defaults to the name of the login user

  • Hello

    I have a user that has db_owner on a database. When the user creates a view the name of the view defaults to the network login like 'SomeDomain\userid.dbo.viewname'. Even when the view is renamed it will not delete the 'SomeDomain\userid' portion of the name. Why does this happen and how can I change it?

  • Make sure that the user's default schema is dbo or whatever other schema you want the views to be created in. Or ask him/her always to specify the schema when creating objects. Since they're only views, I think the best way to correct the existing ones is to drop and recreate.

    John

  • You'll need to use the ALTER SCHEMA command to change the schema, a rename won't work.

  • Thanks everyone that worked.

  • Also more importantly why were schema created with the user's name.

    i know there are some third party tools that do this, but usually there is no need for it.

    I suggest you assign the users a default schema that makes sense for you (dbo or some other schema),

    and clean up all the other user name schemas, that are probably filling up with unintentionally created

    objects as we speak.

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

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