日期:2014-05-17 浏览次数:20601 次
USE master
GO
CREATE DATABASE xxxx
ON
( NAME = xxxx_dat,
FILENAME = 'D:\xxxx_dat.mdf',
SIZE = 400)
LOG ON
( NAME = 'xxxx_log',
FILENAME = 'D:\xxxx_log.ldf',
SIZE = 100MB)
GO
USE master
GO
restore database xxxxfrom disk='d:\xxxx_init.dat'
with
MOVE 'xxxx_Data' TO 'D:\xxxx_dat.mdf',
MOVE 'xxxx_Log' TO 'D:\xxxx_log.ldf',
replace
GO
USE master
GO
sp_addlogin 'xxxxdba', 'xxxxdbaa', 'master'
GO
USE master
GO
sp_addsrvrolemember [xxxxdba], 'sysadmin'
GO
USE xxxx
GO
sp_grantdbaccess 'xxxxdba'
GO