Share via


An Overview of the New Database Project Wizard

You can use the New Database Project Wizard as an easy way to create the database project, optionally import a schema from a database, and configure your build settings. Although you can follow these steps manually, the wizard guides you through the steps until you become more familiar with them or until you have to adjust advanced settings that are not available in the wizard.

For more information about how to access the wizard, see How to: Create Database and Server Projects.

Specify Project Properties

You use this page of the wizard to specify properties about the database project that you want to create. You must have permissions to access the source database. For more information, see Required Permissions for Database Features of Visual Studio.

Field

Default Value

Notes

What type of project would you like to create?

A database project to manage changes to a user-defined database

This field indicates the type of project that you want to create. Specify a database project if you want to manage changes to database objects such as tables, indexes, and stored procedures. Specify a server project if you need to manage changes to objects in the "master" database, or if you need to manage changes to shared server objects such as logins or keys.

Project organization

Organize my project by object type

This field indicates whether the files in the database project are organized primarily by schema or by object type. If your database contains multiple schemas that include logical groupings of database objects, you might want to organize them by schema.

Important noteImportant
You cannot change the automatic file organization after the project is created. You can manually rearrange files after they are added to the solution, but they will always be added according to the specified project organization.

Include schema name in the file name

Yes

This check box indicates whether the schema name should be included as part of the file name for database objects. For example, if the dbo schema contains a table that is named Orders and this check box is selected, the file name is dbo.Orders.table.sql. If this check box is cleared, the file name is Orders.table.sql.

Set Database Options

You use this page of the wizard to specify options on the database. Later, you can adjust these options in the project properties. For more information, see How to: Configure Database Properties for Database Projects.

Field

Default Value

Notes

ANSI padding

Yes

ANSI nulls

Yes

ANSI warnings

Yes

Arithmetic abort

Yes

Numeric round abort

No

Concat nulls yields null

Yes

Quoted identifier

Yes

Enable full-text search

Yes

This check box indicates whether full-text search support should be enabled in the target database.

Database collation

SQL_Latin1_General_CP1_CS_AS

Default schema for new objects

dbo

This field indicates which schema you should put objects into when you add objects to the database project.

For more information about these settings, see An Overview of Database Project Settings.

Import Database Schema

You use this page of the wizard to specify a source database from which to import the database schema. In addition, you can set options that configure aspects of the import operation.

Field

Default Value

Notes

Import existing schema

No

If you select this check box, you can specify a database from which to import a database schema and settings. If you clear this check box, you will create an empty database project into which you can later import a database schema or into which you can add objects.

NoteNote
The other fields in this section are enabled only if you select this check box.

Source database connection

None

You use this field to specify the source database from which you want to import the database schema. If no connection is available, you can create one. For more information, see How to: Create a Database Connection.

If you do not specify a source database connection, no schema will be imported, but you can import other project settings. This strategy is useful, for example, if you create a database and want to use the wizard to configure the project properties, database options, and build and deployment settings.

Script the column collation only if it is different from the database collation

Yes

If you select this check box, the build script will set the collation for only those columns whose collation does not match the database collation. If you clear this check box, database columns will always have their collation scripted, even if it matches the database collation.

Import extended properties

Yes

If you select this check box, extended properties (such as sp_addextendedproperty, sp_settriggerorder, sp_tableoption, and sp_indexoption statements) will be imported. If you clear this check box, extended properties will be ignored. Extended properties can specify a caption for a table or view or an input mask for a column.

Import log and filegroup file sizes

No

If you select this check box, the sizes for log files and filegroup files will be imported into your database project. If you clear this check box, the log files and filegroup files in your database project will have the default size.

Import permissions

No

If you select this check box, the permissions that are defined in the source database will be imported into your database project. If you clear this check box, no permissions will be imported.

Add imported permissions to the project model

No

This option is available only if you have selected the Import permissions check box. If you select this check box, the in-memory model of the database will include the permissions that you imported from the source database. If you select this check box, you can cause a significant decrease in performance. If you clear this check box, permissions will be imported but will not be added to the model.

Override database configuration with imported schema settings

No

If you select this check box, the database settings in the source database will override the settings that you specified on the Set Database Options page. If you clear this check box, the database settings in the source database will be ignored in favor of the settings that you specified on the Set Database Options page.

Maximum files per directory

1000

When you import a database, each database object (such as a table, a stored procedure, or a user) is stored in a separate file on disk. If you have a large number of files in a single folder, performance might degrade, particularly if that folder is under version control. By using this option, you can restrict the number of files placed in each folder to prevent performance from degrading.

Configure Build/Deploy

You use this page of the wizard to specify how the database project should be built and deployed.

Field

Default Value

Build output path

.\sql\debug\

Target connection

None

Target database name

The name that you specified for the project in the New Project dialog box

Default deployment collation

Use the collation of the server

Always re-create database

No

Block incremental deployment if data loss might occur

Yes

Back up database before deployment

No

For more information about these settings, see An Overview of Database Project Settings.

See Also

Tasks

How to: Create Database and Server Projects

How to: Create Empty Database and Server Projects

How to: Import Database Objects and Settings

How to: Import Server Objects and Settings

Concepts

An Overview of Database Build and Deployment

Starting Team Database Development

Writing and Changing Database Code