Buscar este blog

miércoles, 3 de junio de 2009

SQL Server 2005 - 2008 FILEGROUP

1. FILEGROUP.
1.1. Creo los filegroup .

Entrar al sevidor, ir a la base de datos Northwind, propiedades/filegroups, creo dos filegroup uno con nombre fileg1 y otro con fileg2

1.2. Creo los files.

Entrar al sevidor, ir a la base de datos Northwind, propiedades/files, creo dos files uno llamado fileg1 y fileg2 igual que los filegroup, le asigno el filegroup correspondiente a cada uno de igual nombre y direcciono los los archivos en D:\ Temp\ ndf (Por ejemplo).

1.3.Creo las tablas

Creo dos tablas una en fileg1 y otra en fileg2.
Ya tenemos en nuestra base dos tablas con distintos filegroup.


USE [Northwind]
GO
/****** Object: Table [dbo].[ordercopy] Script Date: 11/20/2008 18:03:11 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ordercopy1](
[SalesOrderID] [int] NOT NULL,
[SalesOrderDetailID] [int] NOT NULL,
[CarrierTrackingNumber] [nvarchar](25) NULL,
[OrderQty] [smallint] NOT NULL,
[ProductID] [int] NOT NULL,
[SpecialOfferID] [int] NOT NULL,
[UnitPrice] [money] NOT NULL,
[UnitPriceDiscount] [money] NOT NULL,
[LineTotal] [numeric](38, 6) NOT NULL,
[rowguid] [uniqueidentifier] NOT NULL,
[ModifiedDate] [datetime] NOT NULL
) ON [fileg1]
---------------------------------------------------------------------

USE [Northwind]
GO
/****** Object: Table [dbo].[ordercopy] Script Date: 11/20/2008 18:03:11 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ordercopy2](
[SalesOrderID] [int] NOT NULL,
[SalesOrderDetailID] [int] NOT NULL,
[CarrierTrackingNumber] [nvarchar](25) NULL,
[OrderQty] [smallint] NOT NULL,
[ProductID] [int] NOT NULL,
[SpecialOfferID] [int] NOT NULL,
[UnitPrice] [money] NOT NULL,
[UnitPriceDiscount] [money] NOT NULL,
[LineTotal] [numeric](38, 6) NOT NULL,
[rowguid] [uniqueidentifier] NOT NULL,
[ModifiedDate] [datetime] NOT NULL
) ON [fileg2]

No hay comentarios:

Publicar un comentario