0% found this document useful (0 votes)
94 views

Building The Pics2Share Sample Database-3

This document provides instructions for building a sample MSDE database called MyPics using SQL scripts. The steps include: 1) Creating the database using the 01_Pics2Share_BuildDB.sql script 2) Creating database objects like tables and stored procedures using the 02_Pics2Share_CreateObjects.sql script 3) Adding database users and permissions using either the 03_Pics2Share_IntegratedSecurity.sql script (for integrated authentication) or the 03_Pics2Share_StandardSecurity.sql script (for standard security) after making appropriate edits 4) Adding sample data using the 04_Pics2Share_AppRolesAndUsers.sql script

Uploaded by

Ardi Setiyawan
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
94 views

Building The Pics2Share Sample Database-3

This document provides instructions for building a sample MSDE database called MyPics using SQL scripts. The steps include: 1) Creating the database using the 01_Pics2Share_BuildDB.sql script 2) Creating database objects like tables and stored procedures using the 02_Pics2Share_CreateObjects.sql script 3) Adding database users and permissions using either the 03_Pics2Share_IntegratedSecurity.sql script (for integrated authentication) or the 03_Pics2Share_StandardSecurity.sql script (for standard security) after making appropriate edits 4) Adding sample data using the 04_Pics2Share_AppRolesAndUsers.sql script

Uploaded by

Ardi Setiyawan
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
You are on page 1/ 3

Building the MyPics Sample Database

Brian A. Randell
MCW Technologies, LLC
January 2004
Applies to:
Microsoft SQL Server Desktop Engine (MSDE) 2000 Release A
Summary: Demonstrates how you to create a sample MSDE database using pre-
defined SQL scripts and OSQL.EXE for use with other walkthroughs using ASP.NET 1.1
(3 printed pages)

Contents
Creating the Database
Creating the Database Objects
Adding the Database Users
Adding the Sample Data

Introduction
In order to get started, you will need to have access to a machine with Microsoft SQL
Server Desktop Engine (MSDE) 2000 Release A installed and running (In addition, you
can use a licensed copy of SQL Server 2000 Personal, Standard, Enterprise, or
Developer Edition).
You will be using the OSQL.EXE command-line tool to execute pre-defined SQL scripts.
In this walkthrough, you will need to provide the correct MSDE server (and possibly
instance) name. In addition, if you are using standard security you will need to
provide a valid user name and password.
Note: The steps below assume that the MSDE instance you want to use is the
default instance and that you are using integrated security.

Prerequisites
To follow this walkthrough, the following software and components must be installed
on your development computer:
• Microsoft SQL Server Desktop Engine (MSDE) 2000 Release A
• The 01_Pics2Share_BuildDB.sql, 02_Pics2Share_CreateObjects.sql,
03_Pics2Share_IntegratedSecurity.sql, 03_Pics2Share_StandardSecurity.sql, and
04_Pics2Share_AppRolesAndUsers.sql script files, which are provided in the
walkthrough support files.

Creating the Database


1. Open a command window by select Start, Run and then typing CMD and select
OK.
2. Change to the directory containing the five .SQL files included with this
walkthrough.
3. At the command prompt type:
osql -E -i 01_Pics2Share_BuildDB.sql
4. This will run the T-SQL commands stored in the script file and exit if successful.
5. Keep the command window open.

Creating the Database Objects


In this section, you run a SQL script that will create all of the database objects. You
will continue to use the existing command windows.
6. At the prompt type:
osql -E -i 02_Pics2Share_CreateObjects.sql
7. This will run the T-SQL commands stored in the script file and exit if successful.
8. Keep the command window open.

Adding the Database Users


There are two scripts provided to set up the database users. You will run only one of
them performing steps defined under Using Integrated Security or Using Standard
Security.

Using Integrated Security


If you are going to use integrated security, you will need open
03_Pics2Share_IntegratedSecurity.sql using a text editor such as notepad.exe
and perform a Find & Replace.
If you are going to run the sample on Windows 2003, you will need to find
MACHINE_NAME\ASPNET and replace it with NT AUTHORITY\NETWORK
SERVICE.
If you are going to run the sample on either Windows NT or Windows XP, you need to
find MACHINE_NAME and replace it with your computer’s name.
Once the edits are complete, save the file and perform the following steps:
9. At the prompt type:
sql -E -i 03_Pics2Share_IntegratedSecurity.sql
10. This will run the T-SQL commands stored in the script file and exit if successful.
11. Keep the command window open.

Using Standard Security


If you are using standard security, open 03_Pics2Share_StandardSecurity.sql
using a text editor such as notepad.exe and perform a Find on the string password
and Replace it with a new secure password string. You will use this for the pre-defined
account WebUser.
12. At the prompt type:
osql -E -i 03_Pics2Share_StandardSecurity.sql
13. This will run the T-SQL commands stored in the script file and exit if successful.
14. Keep the command window open.

Adding the Sample Data


In this last section you will add some sample data.
15. Using the existing command prompt:
osql -E -i 04_Pics2Share_AppRolesAndUsers.sql
16. You can now close the command-prompt.

You might also like