Drop User

  • Hi

    I want to drop a user,when i try this am getting error that the database own objects.Now i found that the user owns schema in a database.i want to change the schema of some table.How can i achieve that.

    TIA

  • Either change the user so that he no longer owns the schema or use ALTER SCHEMA to change the schema of your table.

    You are probably better off changing the owner and stripping off any schemas he may own first.

    Kenneth FisherI was once offered a wizards hat but it got in the way of my dunce cap.--------------------------------------------------------------------------------For better, quicker answers on T-SQL questions, click on the following... http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]For better answers on performance questions, click on the following... http://www.sqlservercentral.com/articles/SQLServerCentral/66909/[/url]Link to my Blog Post --> www.SQLStudies.com[/url]

  • To change MSSQL table owner

    sp_changeobjectowner '[DATABASE_NAME].[TABLE_NAME]' , 'NEW_OWNER_NAME'

    😀

    Sanz
  • Thanks Dude its worked liked anything

    😀

  • Just remember that sp_changeobjectowner is a SQL 2000 function and is being deprocated. They recommend using ALTER SCHEMA or ALTER AUTHORIZATION in SQL 2005.

    Kenneth FisherI was once offered a wizards hat but it got in the way of my dunce cap.--------------------------------------------------------------------------------For better, quicker answers on T-SQL questions, click on the following... http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]For better answers on performance questions, click on the following... http://www.sqlservercentral.com/articles/SQLServerCentral/66909/[/url]Link to my Blog Post --> www.SQLStudies.com[/url]

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

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