sql server2005中创建数据库登录用户后,使用该被创建用户登录到数据库中:
CREATE LOGIN [shuiqingtinglin]
WITH PASSWORD=N'shuiqingtinglin!',
DEFAULT_DATABASE=[MYDB],
DEFAULT_LANGUAGE=[us_english],
CHECK_EXPIRATION=OFF, CHECK_POLICY=ON
GO
USE [MYDB]
GO
CREATE USER [shuiqingtinglin] FOR LOGIN [shuiqingtinglin]
GO
EXEC sp_addrolemember N'db_owner', N'shuiqingtinglin'
GO