CREATE DATABASE [abc] ON
( FILENAME = N'E:\db\abc.mdf' ),
( FILENAME = N'E:\db\abc_log.ldf' )
FOR ATTACH
GO
if not exists
(select name from master.sys.databases sd
where name = N'abc' and SUSER_SNAME(sd.owner_sid) = SUSER_SNAME() )
EXEC [abc].dbo.sp_changedbowner @loginame=N'sa', @map=false
GO
posted on 2010-12-16 08:37
Victor.Stone 阅读(222)
评论(0) 编辑 收藏 引用 所属分类:
DB