Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change database Schema name in database project vs2012

I have a database project that currently is using "dbo" schema. I want to update the dbo to something else.

I am able to find the project setting to change the default dbo schema name, but it only works for the new added table. How can I update existing table from dbo to something else.

Please help me,

like image 698
retide Avatar asked Mar 20 '23 06:03

retide


1 Answers

  1. Open your object, in this case a table.
  2. In the T-SQL view for the table, highlight the table name.
  3. Under the "SQL" menu at the top of the IDE, choose "Refactor" - "Move to Schema"
  4. Select the new schema (and I'd recommend previewing the changes as well)
  5. If you're happy with the proposed changes, click "Apply". If not, click "Cancel".

To change the default schema for all future objects, right-click the Project and select "Properties". Under "Project Settings", change the Default Schema in the "General" section. That won't change existing objects, but new ones will be created in that schema.

like image 159
Peter Schott Avatar answered Apr 22 '23 19:04

Peter Schott