views:

69

answers:

1

How to create user and connect user in sql server 2000?

A: 

In SQL Server 2000 if you are connected as a user with ALTER ANY LOGIN rights you can run this to create a login as set a default DB.

EXEC sp_addlogin 'MyName', 'MyPwd', 'MyDB';
GO

In 2005, connected as an admin or a user with ALTER ANY USER rights you can execute this to create a user

CREATE LOGIN MyName
    WITH PASSWORD = 'MyPwd';
USE MyDBName;
CREATE USER MyName FOR LOGIN MyName;
GO

If you are trying to include SQL Server Express / MSDE in an installation set you need to look at Unattended Installation. Look at Creating a Setup File Manually on MSDN.

Gary.Ray
This is SQL 2005 syntax.
gbn
With 200??? in the OP I didn't realize it was 2000 specific.
Gary.Ray
The title said it, even if content was wrong.
gbn

related questions