在SQL Server下用代码创建数据库


--create database 数据库文件名

create database Learning_data         
containment = none
on primary
(
   --name='数据库文件名',filename='存放路径\数据库名.mdf',size=文件大小,maxsize=大于size(文件大小)或unlimited,filegrowth=增长量(MB/%)表示
   name='Learning_data', filename='F:\Learning_db\Learning_data.mdf',size=5120KB,maxsize=unlimited,filegrowth=1024KB
)
log on
(
   --name='数据库文件名_log',filename='存放路径\数据库名.ldf',
   name='Learning_data_log', filename='F:\Learning_db\Learning_data.ldf',size=2048KB,maxsize=3072KB,filegrowth=10%
)
go


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM