Skip to content

Instantly share code, notes, and snippets.

@rponte
Created September 28, 2010 21:03
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/601774 to your computer and use it in GitHub Desktop.
Save rponte/601774 to your computer and use it in GitHub Desktop.
-- create and alter database on SQLSERVER2005
CREATE DATABASE SysPDVWeb;
go
alter database MyDb
modify file
(name = 'MyDb',
size = 20mb,
filegrowth = 5%);
go
alter database MyDb
modify file
(name = 'MyDb_Log',
filegrowth = 100mb);
go
-- 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