Create a Team DB Pro Project                                                        
•        By default, Visual Studio 2005 Professional and higher allows you to create a generic database project.


-        This type of project allows you to create simple SQL scripts used to create and modify objects as well
as define SQL queries in existing databases.
-        A database project can reference one or more existing databases.
-        It can be used to connect to multiple types of data sources, such as ODBC, Ole Db, Oracle, Access,
SQL Server and SQL Server CE.

•        Above this project template in the “New Project” tree structure is “Database Projects”.


•        Inside here, you’ll find a subsection called “SQL-CLR”.
-        The two project templates located here are specific to VB and C#.
-        These are the same SQL Server 2005 database project templates you have under Visual C# and Visual
Basic project types.

•        These project templates allow you to define SQL 2005 database objects based on .NET.
-        For example, you can create a stored procedure in either C# or VB.
-        This is possible because SQL 2005 database engine is based on classic data manipulation with SQL as
well as the .NET 2.0 CLR.
-        Objects written in .NET will perform slower than classic SQL objects but might be easier to create and
maintain based on developer skill set.
•        The unique project types for Team DB Pro lie under “Microsoft SQL Server”.


-        These four project templates are used to create SQL 2000 and SQL 2005 database projects.
-        Obviously, you can either create a manual project or use a wizard to create s project (best choice for
beginners).

•        Here, you create a SQL Server 2005 database project using the wizard, naming it “TestDB2005”.
-        The New Database Project Wizard appears.

•        As you can see, this wizard allows you to set project properties and database options for the database
project.
-        It also guides you through importing a database schema from an existing database, as well as helping
you with database deployment.

•        The next page in the wizard is important. How do you want to organize your project files?


•        By organizing your project files based on object file types, it is assumed that you want all the tables
together, all the stored procedures together, all functions together, etc.
-        This is a good choice if you are not working with a lot of schemas.
•        By organizing your project by schema, there is a true separation of database objects among offline
database representations.
-        If you are working with multiple database schemas, it makes sense to organize your project files based
on schemas.
•        IMPORTANT: Once you choose one of these two settings and click Finish, you cannot change your
project back to a different view.
•        Note some of the other settings.
-        You can set the project to use schema names in the files names.
-        You can also enable the SQL CLR, allowing for .NET database objects.
•        The next screen allows you to set database project options, such as handling collation.


-        These options can later be adjusted in the database project.

•        The next screen allows you to import a database schema.


•        By default, this screen is disabled, unless you decide to import a schema at this point.
-        If you choose to leave the box unchecked, you can always import database schemas after the project is
created.
•        Check the box and import an existing database schema.
-        Make note of the two Connection buttons (albeit disabled here) above.

•        You will be prompted to choose a database that you’ve already connected to from the Server Explorer.


-        If a specific database is not shown in the list, you can click “New Connection” to add a connection to
your Server Explorer.
-        Alternatively, you can click Edit Connection to modify the way you are connecting to a database.

•        By choosing the AdventureWorks database, you use the sample database included with SQL Server
2005.


-        The other checkboxes offer you the ability to import extended database object properties (for example,
table or view captions) and overriding basic database settings.
-        For the most part, you accept the default settings for these checkboxes.

•        The final screen allows you to set build properties.


-        These settings can also be changed after the project is created.
•        You can specify the output folder for your database script.
-        The default value (.\sql\) will be relative to your project’s path.
•        You can also specify the new database’s name
-        If you do not specify how it should connect to the SQL Server, the same SQL Server instance that you
created the schema from will be used.
•        Finally, you can choose whether or not the database should be dropped and recreated every time it’s
deployed.
•        When you click Finish, you’ll notice that a lot of worked is being performed on your behalf.


-        This may take a few minutes, depending on the size and the number of objects in your database.
-        The information shown in the dialog is stored in the log file specified.
•        After the project is created, the database schema is imported, based on all of the objects in the database.
•        A SQL script is also created that represents the database.
-        This is essentially what Team DB Pro manages for you.
Team DB Pro Project
Table of Contents
Copyright (c) 2008.  Intertech, Inc. All Rights Reserved.  This information is to be used exclusively as an
online learning aid.  Any attempts to copy, reproduce, or use for training is strictly prohibited.
Courseware
Training Resources
Tutorials