create database Transdb
on primary
( name= Transdb ,
filename=" D:\SQL\MSSQL\Data\Transdb.mdf",
size=5,
maxsize=20,
filegrowth= 1 )
log on
( name=Translog,
filename=" D:\SQL\MSSQL\Data\Translog.ldf",
size=2,
maxsize=8,
filegrowth=1)
go
set nocount on
set dateformat ymd
use master
go
if not exists(select * from syslogins where name=user01)
exec sp_addlogin user01,user01
go
/create database/
if exists(select *from sysdatabases where name=Transdb)
drop database Transdb
go
create database Transdb
on primary
(name=Transdb ,
filename="D:\database\Transdb.mdf",
size=1,
maxsize=5,
filegrowth=1)
log on
(name=CarLog,
filename="D:\database\TransLog.ldf",
size=1,
maxsize=5,
filegrowth=1)
go
/data mydatabase/
use Transdb
go
/* add my user*/
exec sp_adduser user01,user01
go