SQL Server Notes - sql statement to create database

  Each database of MS SQLServer contains:
  1 master data file (.mdf) required.
  1 transaction log file (.ldf) required.
  Can contain:
  any number of secondary data files (.ndf)
  multiple transaction log files

CREATE DATABASE DATABASENAME ON PRIMARY--配置主数据文件的选项

     (

           name ='databases_data',--represents the logical name of the database

           filename ='path/databases_data.mdf',--represents the physical file name of the database

           size =xxMB,--represents the initial size of the database

           maxsize=xxMB,--represents the maximum size of the database

           filegrowth=xx--Indicates the growth rate of the file (can be a percentage or MB)

       )

LOG ON  --配置日志文件的选项

    (

           name ='databases_log,--represents the logical name of the database

           filename ='path/databases_log.ldf,--represents the physical file name of the database

           size =xxMB,--represents the initial size of the database

           maxsize=xxMB,--represents the maximum size of the database

           filegrowth=xx--Indicates the growth rate of the file (can be a percentage or MB)

    )

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324690818&siteId=291194637