Sunday 14 October 2012

How to Add data file to database using T-SQL COMMEND

                         
Creating database: T-SQL Command
1.       Open Query Analyzer
2.       SELECT master database from the database drop down or issue USE MASTER command and execute
3.       Type the following command and press F5 to execute:
ALTER DATABASE MyDB
ADD FILE
(
NAME = MyDB_dat2,
FILENAME = 'E:\DATA\MyDB_data2.mdf',
SIZE = 100MB,
FILEGROWTH = 25MB
),
(
   NAME = MyDB_dat3,
   FILENAME = 'E: \DATA\MyDB_data3.mdf',
   SIZE = 100MB,
   MAXSIZE = 150MB,
   FILEGROWTH = 25MB
);

No comments:

Post a Comment