1

I have DataBase Name: PMKIT, prefix Table : PMKIT.TableName.I want rename PMKIT.TableName to DBO.TableName. Can you help me!

enter image description here

Ngoc Duy
  • 89
  • 3
  • 9
  • Possible duplicate of [Change Schema Name Of Table In SQL](https://stackoverflow.com/questions/15482838/change-schema-name-of-table-in-sql) – Diado Jul 18 '18 at 11:21
  • 2
    `PMKIT` and `dbo` are a schema. The name of the object is `TableName` and is it on the **schema** `PMKIT`, which (confusingly) is in the database `PMKIT`. As @Diado has pointed out, you therefore want to change the schema of the object, you aren't changing it's name. – Thom A Jul 18 '18 at 11:24

1 Answers1

2

You need to transfer your table from PMKIT schema to dbo schema:

ALTER SCHEMA dbo TRANSFER PMKIT.TableName;  

Read more here: https://learn.microsoft.com/en-us/sql/t-sql/statements/alter-schema-transact-sql?view=sql-server-2017

Or you can follow these steps to perform the same action via Management Studio user interface

  1. Right click on your table and select Design
  2. In Design view, open the properties window(Simply hit the F4 key on keyboard)
  3. Find the Schema property and change it
  4. Save your changes, and close the Design view
Vahid Farahmandian
  • 6,081
  • 7
  • 42
  • 62