112 Part I EXAM PREPARATION The file names

112 Part I EXAM PREPARATION The file names given to all data and log files can be any desired name, although it is recommended that you select a name that gives some indication as to the content of the file. The file extensions for the primary data file, secondary data file(s), and log files can also be any chosen set of characters. It is recommended for consistency and standardization that the extensions be .mdf, .ndf, and .ldf for the primary, secondary, and log files, respectively. Creating Database Files and Filegroups All files needed for a database can be created through a single activity using SQL Server s Enterprise Manager, or with a single CREATE DATABASE Transact SQL statement. Either of these methods can be used to initialize all files and create the database and logs in a single step. The number of files you create and the placement of the files are addressed a little later in this chapter. (See the sections, Using Filegroups and File Placement. ) The default names for the primary database and transaction log files are created using the database name you specified as the prefix for example, NewDatabase_Data.mdf and NewDatabase_Log.ldf. These names and locations can be changed if desired from the default values provided for the new database file. The Transact SQL (T-SQL) syntax for creating a database is as follows: CREATE DATABASE databasename [ON[[,…n]][,[,…n ]]][LOG .ON{[,…n ]}] [COLLATE collationname][FOR LOAD| FOR ATTACH] ::= [PRIMARY] ([NAME=logicalfilename,][FILENAME= physicalfilename ] .[,SIZE=size][,MAXSIZE={size| UNLIMITED}] [,FILEGROWTH=growthincrement]) [,…n ]::=FILEGROUP filegroupname .[,…n ]] In the procedures that follow, you have the opportunity to create a database one step at a time. There are two techniques that can be used for these procedures. The first option uses the Create Database Wizard tool and Enterprise Manager in Step by Steps 3.1 and 3.2. The second option available provides for the syntax for the creation of a database using T-SQL code.

If you looking for unlimited one inclusive web hosting plan please check unlimited web hosting website.

Comments are closed.