Creating Database In SQL
METHOD 1
Create database rose
OR
Create database roses on primary
(name='roses',
filename='D:\database\roses.mdf',
size=5mb,
maxsize=unlimited,
filegrowth=1mb)
log on
(name='roses_log',
filename='D:\database\roses.ldf',
size=5mb,
maxsize=unlimited,
filegrowth=10%)
METHOD 2
Create database srose on primary
(name='srose',filename='D:\database\srose.mdf',
size=5mb,maxsize=unlimited,filegrowth=1mb)
METHOD 3
Create database rose2 on primary
(name='rose2',
filename='D:\database\rose2.mdf',-----(main extention)
size=5mb,
maxsize=unlimited,
filegrowth=1mb),
filegroup myfilegrp1
(name='rosefilegrp1',
filename='D:\database\rosefilegrp1.ndf',----(for saving the extention)
size=5mb,
maxsize=unlimited,
filegrowth=1mb),
filegroup myfilegrp2
(name='rosefilegrp2',
filename='D:\database\rosefilegrp2.ndf',
size=5mb,
maxsize=unlimited,
filegrowth=1mb)
log on
(name='rose2_log',
filename='D:\database\rose2.ldf',
size=5mb,
maxsize=unlimited,
filegrowth=10%)
ENABLING FILESTREAM
exec sp_configure filestream_access_level,3
reconfigure
create database teksoft
on
primary(name=teksoft,
filename='D:\data\teksoft.mdf'),
filegroup filestreamgroup contains filestream(name=teksoft_data,
filename='D:\data\teksoft_data')
log on(name=log1,filename='D:\data\teksoft\ldf')
go
RENAME A USER-DEFINED DATABASE
sp_renamedb db1, db2
Here,
db1 is the current name of the database
db2 is the new name of the database
DELETE A USER-DEFINED DATABASE
Drop database Employee
Here,
Employee is the name of database
No comments:
Post a Comment