CS 112D Lecture Notes - MSDE Basics and VS.NET Database Projects (Chapter 3 up to page 91 and Chapter
8)
Installing the MSDE (Chapter 3 up to p.91)
The Microsoft SQL Server Desktop Engine (MSDE) comes with some versions of Visual Studio .NET (VS.NET) and
Visual Basic .NET (VB.NET). It is also available for free download from:
The MSDE site on the MSDN. It is a
simplified version of SQL Server, intended for small-scale development. Everything we do this semester can
be done on the MSDE, but if you have a full-fledged installation of SQL Server version 7 or 2000, you can
use that instead.
The MSDE is not installed by default when you install VS.NET. The VS installer merely copies the setup
files for MSDE to a directory on your hard drive. Before using the MSDE, you must install it. By default,
VS.NET setup places the files in
C:\Program Files\Microsoft Visual Studio .NET\Setup\MSDE
If
you installed Visual Studio in another location, you'll have to look for the files there.
Run the setup program by double-clicking on Setup.exe. What you will see is a special install for the
MSDE. It is different from the install program for SQL Server. It's very simple and quick (you may even
wonder if it really did anything). After you restart the computer, the MSDE will be up and
running, visible in the task bar. It can also be found via the following sequence of commands:
Control Panel -> Administrative Tools -> Services -> MSSQL$VSdotNET
Database Projects in Visual Studio .NET (Chapter 8)
- The MSDE doesn't include any kind of interface for manipulating databases, but VS.NET includes such
capability via the Server Explorer and Database Projects.
- Server Explorer allows you to create databases, tables, etc. with a GUI similar to Microsoft
Access.
- a Database Project allows you to write, save, and execute SQL scripts to create or modify a
database's structure, and to modify or retrieve data from the database.
- Using a Database Query in a Database Project, you can write your SQL code with the aid of a
graphical Query Designer.
- To access the Database Project template, from the File menu, point to New, and click Project. In the
New Project dialog box, expand Other Projects, select Database Projects, and choose the Database Project
template.
- The Database Project template creates the following folders in Solution Explorer:
- Change Scripts -
Change scripts record a series of modifications you intend to make to a database diagram or selected
database tables. They are useful because they can be run at another time if you do not have security
permissions to alter a database or if you are not ready to update the database.
- Create Scripts - Create scripts recreate part (or all) of a database. They are useful for
resetting a database object to its original condition. If you have a full-fledged version of SQL Server
installed, Create Scripts will be available as part of your Database Project. If you only have the
MSDE, Create Scripts are not available.
- Queries - Queries retrieve, create, modify, or delete data in a database. A graphical Query
Designer is available to help you write queries that are created using the Database Query template.
- Database References - Each database reference contains connection information to a database
and is saved as part of the project. A database project can have multiple database references.
- To setup a database reference, you'll need the Server Name, which can be found in the Server
Explorer, under the database's "Server" property. My server name was my computer name followed by:
\VSDOTNET
- Running SQL Scripts in Solution Explorer - You can run SQL scripts in Solution Explorer by
dragging a script file to a database in the Database References folder. Another way to run SQL scripts is
right-clicking the script and choosing either Run or Run On from the shortcut menu. When you choose Run,
the SQL script runs on the default database. When you choose Run On, you can select which database to
use.
Return to the main CS 112D page