October 1, 2014 at 8:32 am
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?
October 1, 2014 at 8:42 am
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
October 1, 2014 at 8:54 am
You'll need to use the ALTER SCHEMA command to change the schema, a rename won't work.
October 1, 2014 at 9:01 am
Thanks everyone that worked.
October 8, 2014 at 3:47 pm
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