Home All Groups Group Topic Archive Search About

Using a just-created login

Author
7 Nov 2005 9:21 PM
Mike
This may be more of a SQL question. If so, please let me know so I can post
it elsewhere.

I have a high-usage web service app that must create SQL logins on the fly.
The app attempts to connect as the inbound user, and if the login does not
exist, creates the login (via several calls to sp_addlogin, sp_addrolemember
and sp_grantdbaccess), and then re-attempts the connection.

This works fine if I have about a 5-10 second delay between creating the
login and attempting to connect using that user. Anything less and I get a
'Login failed for user xxx' error.

Is this because of connection caching? Why can't I use the connection
immediately after creating it?

Thanks,
Mike

AddThis Social Bookmark Button