Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Import users from excel

Status
Not open for further replies.

kingsgambit

Vendor
Jan 30, 2003
4
GB
I have 200 users to import into sql 2000

I need to import there database username,password and which database they can access

Can I run a script that will read the excel spreadsheet and import the user details
 

You can use DTS to upload your list of user names, passwords and default databases,

You are then going to have to script the creation of your logins

Code:
 CREATE LOGIN [TESTUSER] WITH PASSWORD = 'TESTPASSWORD', DEFAULT DATABASE=[MASTER]

Then for each Database you need to create the appropriate users.

Code:
 USE [TestDB]
GO
CREATE USER [TestUser] FOR LOGIN [TESTUSER] WITH DEFAULT_SCHEMA=[dbo]
GO



I love deadlines. I like the whooshing sound they make as they fly by
Douglas Adams
(1952-2001)
 
Can you explain more please I am new to sql

How do I upload using DTS what format do I use.

Do I upload into the database I want to users to access?

Why do I have to run the script afterwards if I have uploaded the username, password and database?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top