SQLUSA
BI TRIO 2008
FREE TRIAL
CLICK HERE TO ORDER

SQL Server 2008 Best Practices
SQL Server 2005 Best Practices

How to create a FILEGROUP on multiple diskdrives?

The following Microsoft SQL Server T-SQL sample script illustrates FILEGROUP creation with multiple diskdrives:

-- SQL Server add filegroup to database - alter table

USE MASTER

GO

 

ALTER DATABASE SalesDW

ADD FILEGROUP [SalesHistory]

GO

 

ALTER DATABASE SalesDW

ADD FILE

(NAME = N'SalesDWArchive',

FILENAME = N'H:\SQL2005\SalesDW\SalesDWArchive.ndf',

SIZE = 40MB,

MAXSIZE = 5000MB,

FILEGROWTH = 10MB)

TO FILEGROUP [SalesHistory]

GO

 

ALTER DATABASE SalesDW

ADD FILE

(NAME = N'SalesDWArchive',

FILENAME = N'G:\SQL2005\SalesDW\SalesDWArchive.ndf',

SIZE = 2000MB,

MAXSIZE = 30000MB,

FILEGROWTH = 100MB)

TO FILEGROUP [SalesHistory]

GO

The World Leader in SQL Server 2008 Training
The future is just a CLICK away. Your future!
 
SQLUSA.com Home Page

Copyright 2005-2010, SMI Corp. All Rights Reserved.

SQL Server 2008 is a program product of Microsoft Corporation.
SQL Server 2005 is a program product of Microsoft Corporation.
SQL Server 2000 is a program product of Microsoft Corporation.