日期:2014-05-18 浏览次数:20674 次
USE master; GO IF DB_ID (N'Sales') IS NOT NULL DROP DATABASE Sales; GO -- Get the SQL Server data path DECLARE @data_path nvarchar(256); SET @data_path = (SELECT SUBSTRING(physical_name, 1, CHARINDEX(N'master.mdf', LOWER(physical_name)) - 1) FROM master.sys.master_files WHERE database_id = 1 AND file_id = 1); -- execute the CREATE DATABASE statement EXECUTE ('CREATE DATABASE Sales ON ( NAME = Sales_dat, FILENAME = '''+ @data_path + 'saledat.mdf'', SIZE = 10, MAXSIZE = 50, FILEGROWTH = 5 ) LOG ON ( NAME = Sales_log, FILENAME = '''+ @data_path + 'salelog.ldf'', SIZE = 5MB, MAXSIZE = 25MB, FILEGROWTH = 5MB )' ); GO
------解决方案--------------------
在数据库属性中..设置文件的自动增长..
你可以设置为自动增长..然后设置一个百分比值..
也可以不设置自动增长..提供一个最大值.
------解决方案--------------------
为数据库分配存储空间的问题,分配指定的空间之后,数据库好像又“自动”收缩?
---
你怎么分配的空间?
------解决方案--------------------