How to: Modify Database Objects
The database project contains the definitions for the objects in your database. To update your deployed database, you modify the database object in your database project, and then you build and deploy the updated database project to your server. Solution Explorer shows you the files that your database project contains, and Schema View shows you the database objects that are defined in those files.
To modify a database object from Schema View
Open the solution that contains your database project.
If Schema View does not appear, open the View menu and click Database Schema View.
Schema View appears.
In Schema View, expand the database project and locate the object that you want to modify.
Click the database object that you want to modify.
On the View menu, click Open.
The Transact-SQL editor appears. It contains the definition for the database object that you clicked. For more information, see Editing Database Scripts and Objects with the Transact-SQL Editor on the Microsoft web site.
Note
Instead of using the menu, you could also double-click the database object that you want to modify.
Modify the database object to make your change.
On the File menu, click Save FileName.
If you introduce any syntax errors in the object definition, one or more errors appear in the Error List window, and the object might not appear in Schema View until you resolve the errors. You can double-click an error in the Error List window to jump to the source of the error.
You can now build and deploy your updated database project. For more information, see How to: Build a Database Project to Generate a Compiled Schema (.dbschema) File and How to: Deploy Changes to New or Existing Databases.
To modify the file that contains a database object definition from Solution Explorer
Open the solution that contains your database project.
In Solution Explorer, expand the database project and locate the file that contains the object that you want to modify.
Click the file that contains the database object that you want to modify.
On the View menu, click Open.
The Transact-SQL editor appears. It contains the definition for the database object that you clicked.
Note
Instead of using the menu, you could also double-click the database object that you want to modify.
Modify the database object to make your change.
On the File menu, click Save FileName.
If you introduce any syntax errors in the object definition, one or more errors appear in the Error List window, and the object might not appear in Schema View until you resolve the errors. You can double-click an error in the Error List window to jump to the source of the error.
You can now build and deploy your updated database project. For more information, see How to: Build a Database Project to Generate a Compiled Schema (.dbschema) File and How to: Deploy Changes to New or Existing Databases.
See Also
Tasks
How to: Build a Database Project to Generate a Compiled Schema (.dbschema) File
How to: Deploy Changes to New or Existing Databases
How to: Define Permissions for Database Objects