Skip to content

Instantly share code, notes, and snippets.

@rponte
Created September 28, 2010 21:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rponte/601769 to your computer and use it in GitHub Desktop.
Save rponte/601769 to your computer and use it in GitHub Desktop.
-- create a custom database on SQLSERVER2005
CREATE DATABASE MyDb ON PRIMARY
(NAME = MyDb_Data,
FILENAME = 'C:\SQLServerData\Data\MyDb_Data.mdf',
SIZE = 250MB, MAXSIZE = UNLIMITED, FILEGROWTH = 5%)
LOG ON (NAME = MyDb_Log,
FILENAME = 'C:\SQLServerData\Log\MyDb_Log.ldf',
SIZE = 50MB,
MAXSIZE = 200MB,
FILEGROWTH = 5%);
-- check database files
use MyDb;
select file_id, name,
physical_name,
size*1.0/128 as [size in mbs],
max_size,
max_size*1.0/128 as [max_size in mbs],
growth,
growth*1.0/128 as [growth in mbs],
is_percent_growth
from sys.database_files;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment