1 select * from sys.master_files 可以快速获取SQL Server实例中全部数据库的清单
2 创建数据库
use master; create database SBSChp4TSQL on primary ( name = ‘SBSChp4TSQL1‘, filename = ‘C:\SQLData\SBSTSQL1.mdf‘, size = 10mb, maxsize = 20, filegrowth = 10% ) log on ( name = ‘SBSChp4TSQL_log‘, filename = ‘C:\SQLLog\SBSTSQL_log.ldf‘, size = 10mb, maxsize = 200, filegrowth = 20% );
这里的name就是指逻辑名称,默认与数据库名相同,日志会加_log; 物理文件名也是一样. 默认扩展名分别为mdf和ldf