Escolar Documentos
Profissional Documentos
Cultura Documentos
In this task, you will create the schema for the School database and load data into the database. To do this,
you use SQL Server Management Studio or SQL Server Management Studio Express to execute a Transact-
SQL script. The resulting School database is used as the relational data source in the rest of the tasks in this
quickstart.
2. In the Connect to Database Engine dialog box, type either localhost or the name of the local SQL
Server instance, and then click Connect.
3. Paste the following Transact-SQL script in the query window and then click Execute.
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
USE [master];
GO
USE School;
GO
https://docs.microsoft.com/en-us/previous-versions/dotnet/netframework-4.0/bb399731(v=vs.100) 1/15
10/25/2018 Creating the School Sample Database | Microsoft Docs
GO
ALTER TABLE [dbo].[OnlineCourse] CHECK
CONSTRAINT [FK_OnlineCourse_Course]
GO
https://docs.microsoft.com/en-us/previous-versions/dotnet/netframework-4.0/bb399731(v=vs.100) 5/15
10/25/2018 Creating the School Sample Database | Microsoft Docs
@OrigTimestamp timestamp
AS
UPDATE OfficeAssignment SET Location=@Location
WHERE InstructorID=@InstructorID AND [Timestamp]=@OrigTimestamp;
IF @@ROWCOUNT > 0
BEGIN
SELECT [Timestamp] FROM OfficeAssignment
WHERE InstructorID=@InstructorID;
END
'
END
GO
@EnrollmentDate datetime
AS
UPDATE Person SET LastName=@LastName,
FirstName=@FirstName,
HireDate=@HireDate,
EnrollmentDate=@EnrollmentDate
WHERE PersonID=@PersonID;
'
END
GO
2. In the Connect to Database Engine dialog box, type either localhost or the name of the local SQL
Server instance, and then click Connect.
3. In the Object Explorer window, expand the node for the newly connected instance, then expand
Databases, expand School, expand Tables, and review the list of table objects in the database.
https://docs.microsoft.com/en-us/previous-versions/dotnet/netframework-4.0/bb399731(v=vs.100) 14/15
10/25/2018 Creating the School Sample Database | Microsoft Docs
Next Steps
You have successfully created the School database. Next, you will create the class scheduling application:
See Also
Concepts
Quickstart
https://docs.microsoft.com/en-us/previous-versions/dotnet/netframework-4.0/bb399731(v=vs.100) 15/15