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
2009-04-10 17:11:52
This is SQL 2005 syntax.
gbn
2009-04-10 17:16:58
With 200??? in the OP I didn't realize it was 2000 specific.
Gary.Ray
2009-04-10 17:31:46
The title said it, even if content was wrong.
gbn
2009-04-10 18:10:26