You are on page 1of 7

OBJETIVOS DE LA ACTIVIDAD:

 Conocer el entorno de SQL Server 2005 Management Studio


 Crear base de datos y tablas en SQL Server 2005 Management Studio
 Crear el diagrama de la base de datos
 Realizar consultas a las tablas creadas.

ACTIVIDAD A REALIZAR

1. Crear una base de datos en SQL Server 2005

Para este punto se ha creado una base de datos utilizando SQL Server 2008, dicha DB
la llamamos EDI.

2. Consultar la información con que se creó la base de datos.


A continuación adjunto el script de creación de la BD

/****** Object: Database [EDILMA] Script Date: 02/11/2012 16:27:49


******/
CREATE DATABASE [EDILMA] ON PRIMARY
( NAME = N'EDILMA', FILENAME = N'c:\Program Files (x86)\Microsoft SQL
Server\MSSQL10_50.SQLEXPRESS\MSSQL\DATA\EDILMA.mdf' , SIZE = 723712KB
, MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
LOG ON
( NAME = N'EDILMA_log', FILENAME = N'c:\Program Files (x86)\Microsoft
SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\DATA\EDILMA_1.ldf' , SIZE =
319552KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
GO

ALTER DATABASE [EDILMA] SET COMPATIBILITY_LEVEL = 90


GO

IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
EXEC [EDILMA].[dbo].[sp_fulltext_database] @action = 'enable'
end
GO

ALTER DATABASE [EDILMA] SET ANSI_NULL_DEFAULT OFF


GO

ALTER DATABASE [EDILMA] SET ANSI_NULLS OFF


GO

ALTER DATABASE [EDILMA] SET ANSI_PADDING OFF


GO

ALTER DATABASE [EDILMA] SET ANSI_WARNINGS OFF


GO

ALTER DATABASE [EDILMA] SET ARITHABORT OFF


GO

ALTER DATABASE [EDILMA] SET AUTO_CLOSE OFF


GO

ALTER DATABASE [EDILMA] SET AUTO_CREATE_STATISTICS ON


GO

ALTER DATABASE [EDILMA] SET AUTO_SHRINK ON


GO

ALTER DATABASE [EDILMA] SET AUTO_UPDATE_STATISTICS ON


GO

ALTER DATABASE [EDILMA] SET CURSOR_CLOSE_ON_COMMIT OFF


GO

ALTER DATABASE [EDILMA] SET CURSOR_DEFAULT GLOBAL


GO

ALTER DATABASE [EDILMA] SET CONCAT_NULL_YIELDS_NULL OFF


GO

ALTER DATABASE [EDILMA] SET NUMERIC_ROUNDABORT OFF


GO
ALTER DATABASE [EDILMA] SET QUOTED_IDENTIFIER OFF
GO

ALTER DATABASE [EDILMA] SET RECURSIVE_TRIGGERS OFF


GO

ALTER DATABASE [EDILMA] SET DISABLE_BROKER


GO

ALTER DATABASE [EDILMA] SET AUTO_UPDATE_STATISTICS_ASYNC ON


GO

ALTER DATABASE [EDILMA] SET DATE_CORRELATION_OPTIMIZATION OFF


GO

ALTER DATABASE [EDILMA] SET TRUSTWORTHY OFF


GO

ALTER DATABASE [EDILMA] SET ALLOW_SNAPSHOT_ISOLATION OFF


GO

ALTER DATABASE [EDILMA] SET PARAMETERIZATION SIMPLE


GO

ALTER DATABASE [EDILMA] SET READ_COMMITTED_SNAPSHOT OFF


GO

ALTER DATABASE [EDILMA] SET HONOR_BROKER_PRIORITY OFF


GO

ALTER DATABASE [EDILMA] SET READ_WRITE


GO

ALTER DATABASE [EDILMA] SET RECOVERY FULL


GO

ALTER DATABASE [EDILMA] SET MULTI_USER


GO

ALTER DATABASE [EDILMA] SET PAGE_VERIFY CHECKSUM


GO

ALTER DATABASE [EDILMA] SET DB_CHAINING OFF


GO

3. Crear mínimo 7 tablas en la base de datos creada}

Nuestra base de datos contiene alrededor de 54 tablas de las cuales las siguiente
imagen relaciona algunas.
4. A las tablas anteriores insertarles mínimo 5 registros por tablas
Cada una de las diferentes tablas tienes cantidades de registros, lo cual dificulta un poco tomar
las imágenes de cada una de estas, por tal razón solo hacemos referencias algunas de ellas.

5. Realizar diferentes tipos de consultas (select) a las tablas creadas

SELECT TOP 1000 [IdSMessageBox]


,[IdContract]
,[IdMessageBox]
,[IdRecollectType]
,[Status]
,[Message]
,[DBTime]
FROM [EDILMA].[dbo].[SMessageBox]

SELECT TOP (200) SMessageBox.IdSMessageBox, SMessageBox.IdContract,


SMessageBox.IdMessageBox, SMessageBox.IdRecollectType, SMessageBox.Status,
SMessageBox.Message, SMessageBox.DBTime, Contract.Name,
Messagebox.FilePath
FROM SMessageBox INNER JOIN
Messagebox ON SMessageBox.IdMessageBox =
Messagebox.MessageboxId INNER JOIN
Contract ON SMessageBox.IdContract = Contract.ContractId

SELECT TOP 1000 [RecollectId]


,[PartnerId]
,[Orientation]
,[Status]
,[Email]
,[CC]
,[BCC]
,[Folder]
,[Path]
,[UserName]
,[Password]
,[Description]
,[RecollectTypeId]
,[DBUser]
,[DBTime]
,[ContractId]
FROM [EDILMA].[dbo].[Recollect]

6. Crear el diagrama de la base de datos donde se muestren las relaciones entre las 7 o
más tablas creadas.
Como fue dicho en uno de los puntos anteriores nuestra base de datos contiene muchas
tablas lo cual dificulta la visualización de todo el diagrama.

Presentado por:

Jonathan Berthel C

Nota: este es un proyecto trabajado e equipo, por jose mejia David arnedo, crisytian beltran y
wilberto torres

You might also like