Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Error 21770: Name not found in Users collection.

Posted on 1998-08-11
7
Medium Priority
?
939 Views
Last Modified: 2008-02-01
When I add a login to SQL Server using the sp_addlogin
SP, and then go in through the Enterprise Manager to
add that login to a predefined group, I get the error
"Error 21770: The name 'VDnwid' was not found in Users
collection" I cannot add this login to a group.
What should I be doing here?
 
0
Comment
Question by:vd
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 2

Expert Comment

by:connex
ID: 1089533
how exactly to you add the login? (give sp_addlogin line)
This worked fine for me till now

0
 

Author Comment

by:vd
ID: 1089534
Thanks. Here's the line:

isql /U sa /P %1 /S %2 /Q "sp_addlogin %3, %4, %5"

This is obviously executed in a .bat file.
%1 is the sa password; %2 is the server; %3 is the login to be
added; %4 is the password for this login; %5 is the default database for this new login.
0
 
LVL 2

Accepted Solution

by:
connex earned 200 total points
ID: 1089535
Ah thats it :)
You need to call sp_adduser as well.
The sp_addlogin just makes a new entry in the master database about a new login but does not assign it to a db.
just call for the database you want to give the user access

sp_adduser <login_id>[,<username>[,<groupname>]]



0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:vd
ID: 1089536
Thankyou!
0
 

Author Comment

by:vd
ID: 1089537
I added the sp_adduser statement to my procedure (.bat file)
and I still get the same error!
0
 
LVL 2

Expert Comment

by:connex
ID: 1089538
So you do now:

use master
sp_addlogin test
go
use mydb
sp_adduser test
go

Yes?

0
 

Author Comment

by:vd
ID: 1089539
Thanks. That seems to work.
0

Featured Post

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
I have a large data set and a SSIS package. How can I load this file in multi threading?
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question