Oct 7, 2002 #1 markSaunders Programmer Joined Jun 23, 2000 Messages 196 Location 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
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
Oct 7, 2002 #2 osjohnm Technical User Joined Apr 4, 2002 Messages 473 Location ZA 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 Upvote 0 Downvote
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
Oct 7, 2002 Thread starter #3 markSaunders Programmer Joined Jun 23, 2000 Messages 196 Location GB exactly what i needed - missed it in BOL but will now be able to implement Thanks! m Mark Saunders Upvote 0 Downvote