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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using SQL Server to create Domain Users

Status
Not open for further replies.

markSaunders

Programmer
Jun 23, 2000
196
GB
Using SQL Server 2000(sp2) on Win2k (sp2) is it possible to have a stored proc that will create a new NT Domain user?

thanks in advance.

M Mark Saunders :)
 
If you are looking to a SQL login that uses Windows Authentication eg. domain account

Then use the sp_grantlogin built-in stored proc. This creates sql logins.

exec sp_grantlogin 'domain\user'

This will only create the server login, you will still need to add permissions.

If you wanted to create your own stored proc then something like this should work.

CREATE PROCEDURE ADD_NT_USER @user varchar(200)
AS
EXEC sp_grantlogin @user
GO

That will add a domain user as a sql server login.

John
 
exactly what i needed - missed it in BOL but will now be able to implement

Thanks!
m Mark Saunders :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top