Editing Objects in Data-tier Applications
Important
To create and manage databases using the latest version of Data Tier Applications (DACPAC), install the most recent release of SQL Server Data Tools from Get Started with Microsoft SQL Server Data Tools.
After creating a data-tier application (DAC) project, you add the various data-tier objects referenced by your application, such as adding tables, views, and stored procedures. The objects are specified as a script that has the Transact-SQL statements for creating the object. You can later change the characteristics of the object by editing the Transact-SQL statements in the script.
Viewing Objects in Data-tier Applications
You can use either the Solution Explorer or the Schema View to view the existing objects already in the DAC project.
The Schema View displays a hierarchy that includes all of the schema objects in the DAC, such as tables and views. For an individual object, Schema View displays a hierarchy of the elements contained in the object. For example, the node for a table has subnodes for elements such as columns, keys, and indexes.
The schema objects are also displayed in the Solution Explorer hierarchy, but Solution Explorer also includes other types of objects such as project properties, data generation plans, and scripts. Solution Explorer does not display the structure of the objects; it lists the .sql file that has the Transact-SQL script for creating the object.
Editing Objects
There are two ways to add individual objects to a DAC project, from the Project menu or the Schema View hierarchy.
From the Project menu, select Add New Item… to open the Add New Item dialog. In the dialog box, select the template for type of object to add. In the Name box at the bottom of the dialog box, edit the name of the script file to match the name to assign to the object, and then click the Add button.
In either the Schema View, or the Solution Explorer, right-click the node for the object and select Open. This opens the Transact-SQL script (.sql) file for the object in a Transact-SQL Editor window. You then edit the Transact-SQL statements to change the object definition. The Transact-SQL Editor window also includes a Transact-SQL debugger.
For more information about using the Transact-SQL editor, see Editing Database Scripts and Objects with the Transact-SQL Editor.
For more information about using the Transact-SQL debugger, see Debugging Transact-SQL.
While the most commonly used SQL Server database objects are supported in a DAC, others are not. Some Transact-SQL clauses may not be supported in a DAC, and attempting to specify one will generate an error. For more information about a list of the objects that can be defined in a DAC, see Features Supported in Data-tier Applications.
See Also
Concepts
Adding New Objects to Data-tier Applications
Creating Data-tier Application Projects