官术网_书友最值得收藏!

Installing and configuring SQL Server 2005 Express

When you download Microsoft Visual Web Developer 2008 Express, you have the option of downloading Microsoft SQL Server 2005 Express from the same page. When given an option, choose to download Microsoft SQL Server 2005 Express with Advanced Services. This includes Management Studio Express and Full Text Search, both of which are especially handy to have. The SQL Server 2005 Examples and SQL Server 2005 Books Online are not critical for our CMS application, but you will most likely want them if you intend to do any SQL Server programming or extend the application you create in this book.

Once you download the SQL Server 2005 Express executable, run it and accept the licensing agreement. The installation wizard will configure the required components, and will then check your system. Once that is finished, and you have installed everything it asks for, the SQL Server 2005 Express installation will start. When you see the registration information, enter your name and company, then uncheck the Hide advanced configuration options checkbox. We need to change some configuration settings, so your screen should look something like:

Installing and configuring SQL Server 2005 Express

The next installation choice you will have is feature selection, which is chosen to run everything from your hard drive. We won't use everything, but it's easier to have it already installed than to install a new feature the first time you choose to use it. The next choice is how you want to install SQL Express, choose Named Instance and the default name of SQLExpress. Accept the default values for each step, except when you come to the Authentication Mode dialog. Here, we want to set SQL Server 2005 Express to allow Windows or SQL logins, called Mixed Mode authentication. Select Mixed Mode (Windows Authentication and SQL Server Authentication) and enter SimpleCMS as a password for the sa logon account, as shown below:

Installing and configuring SQL Server 2005 Express

In SQL Server, the sa account is the system administration account, similar to the Windows Administrator account. Continue the setup process, accepting the default choices until the setup is complete.

Installing SQL Server 2005 Management Studio Express

If you didn't install SQL Server 2005 Management Studio Express with SQL Server 2005 Express, it can be downloaded individually or as part of the SQL Server 2005 Express Edition Toolkit, which includes Business Intelligence Development Studio (BIDS). BIDS will let you create and manage SQL Server Reporting Services (SSRS), which provides reports on SQL Server operations, as well as allowing you to generate reports from your database. We won't be using BIDS in our project, so we only need Management Studio Express, but you can install either version to work through this book.

When you download Management Studio Express, you will have a Microsoft installation file, or MSI, called SQLServer2005_SSMSEE.msi in your download location. In a Windows system, an MSI file can be run as an executable, so simply double-click the filename to begin the installation. Agree to the licensing and accept all the defaults, unless you need to change the installation location. When the installation finishes, you should find SQL Server Management Studio Express in the SQL Server 2005 program group on your start menu.

Running SQL Server 2005 Management Studio Express

When you start Management Studio Express, you will be presented with a login dialog for the SQL Server. It will have your server name and use Windows Authentication for the connection. This works fine on your local system for development, but if you intend to use Management Studio Express on a hosted web site, you will likely be required to use SQL Authentication for access. If that is the case, your hosting service should be able to provide you with the name of the SQL Server, as well as the login details.

Clicking Connect will connect Management Studio Express to your SQL Server. If you expand the Databases folder, and then expand System Databases, you will see four default databases required for SQL Server—master, model, msdb, and tempdb.

Running SQL Server 2005 Management Studio Express

These four databases are used by SQL Server to store information for SQL Server itself, and you should never need to touch them. The database we create for our application will be separate from these and that will be the only database we use. SQL Server 2005 Express allows the creation of multiple databases, but for our application we will only create one, both because it makes our application simpler to manage and because many web hosting services charge extra for hosting additional databases.

Management Studio Express allows us to perform some important tasks on our database. If you right-click on the master database and choose Tasks, you will see the important Backup and Restore tasks, as well as a Shrink task that allows us to compress the space used by our database. On a web host, this is important because extra space often costs extra. However, in any SQL Server installation, a smaller database will be a better performer. Shrinking the database is a double-edged sword though, since it can lead to fragmentation of the database. It can also be useless, since a database needs some extra space to function and will need to grow larger as it needs the space. Shrinking is most useful in development or updating a database, especially after a table is altered or dropped and large amounts of space may end up empty.

主站蜘蛛池模板: 黄龙县| 仪征市| 商洛市| 即墨市| 建宁县| 康乐县| 博爱县| 赤峰市| 吴堡县| 广丰县| 边坝县| 两当县| 潜山县| 东光县| 德化县| 聂拉木县| 南汇区| 淄博市| 舞钢市| 漯河市| 南雄市| 贡觉县| 晴隆县| 湖南省| 波密县| 喀喇| 前郭尔| 子洲县| 墨玉县| 旬阳县| 邛崃市| 南康市| 汾阳市| 呼伦贝尔市| 广昌县| 怀宁县| 桐庐县| 玛曲县| 永德县| 常宁市| 高碑店市|