114 Part I EXAM PREPARATION continued (NAME = LogStore ,
114 Part I EXAM PREPARATION continued (NAME = LogStore , FILENAME = e:log directoryLogStore_MyDatabase.ldf , SIZE = 1MB, MAXSIZE = 5MB, FILEGROWTH = 1MB) You can use the CREATE DATABASE statement to create a database from script. Saving the script enables you to re-create a similar database on another server in the future. Any SQL Server object can have its creation script saved. The advantages of saving these scripts are discussed later in this chapter. Using the CREATE DATABASE statement to create a database using multiple files and log files would look similar to this: CREATE DATABASE Example ON PRIMARY ( NAME = ExampleData, FILENAME = c:mssqldatasampdat.mdf , SIZE = 10MB, MAXSIZE = 20MB, FILEGROWTH = 2MB), ( NAME = ExampleIndexes, FILENAME = c:mssqldatasampind2.ndf , SIZE = 10MB, MAXSIZE = 20MB, FILEGROWTH = 2MB), ( NAME = ExampleArchive, FILENAME = c:mssqldatasamparch.ndf , SIZE = 10MB, MAXSIZE = 20MB, FILEGROWTH = 2MB) LOG ON ( NAME = ExampleLog1, FILENAME = d:mssqllogsamplog1.ldf , SIZE = 10MB, MAXSIZE = 20MB, FILEGROWTH = 2MB), ( NAME = ExampleLog2, FILENAME = d:mssqllogsamplog2.ldf , SIZE = 10MB, MAXSIZE = 20MB, FILEGROWTH = 2MB) Important issues with regard to appropriate use of the CREATE DATABASE statement are as follows: The default growth increment measure is MB, but can also be specified with a KB or a % suffix. When % is specified, the growth increment size is the specified percentage of the size of the file at the time the increment occurs. A maximum of 32,767 databases can be defined on a server. The minimum size for a log file is 512K.
For high quality website hosting services please check cheap web hosting website.