Monday, January 19, 2009

Creating a user and aliasing the user to dbo

I would not recommend logging in and out and doing all the changes with sa, so I would recommend creating and aliasing a dbo user. I would recommend being careful when creating objects with a user always specify dbo before creating tables and so on

to create a user

USE master
go
EXEC sp_addlogin 'dbo_user','PASSWORD','database','us_english',"user Dbo",null,null,null
go

USE database
go
EXEC sp_addalias 'dbo_user','dbo'
go
drop dbo_user
go
EXEC sp_addalias 'dbo_user','dbo'
go

No comments:

Post a Comment