首页 新闻 会员 周边 捐助

已建Transdb数据库 Transdb.mdf和Translog.ld。改成自己的用户名和登录名,求大神解惑,如何改

0
悬赏园豆:5 [已关闭问题] 关闭于 2020-06-01 13:01

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

留侯君的主页 留侯君 | 初学一级 | 园豆:196
提问于:2020-06-01 12:08
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册