Creating User Accounts | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Creating User Accounts

Hi All Is there any way to create a user account in SQL Server through my program. Can anybody please help….
Thanks In Advance With Best Regards Pradosh
What kind of program you’re having that is connected to SQL Server? Refer to books online for SP_ADDLOGIN & SP_ADDUSER Sps and as it refers: sp_addlogin defines a login account for SQL Server connections using SQL Server Authentication. The user must supply a SQL Server login account and password when connecting to the instance of SQL Server. sp_grantlogin authorizes a Microsoft Windows® network account (either a group or a user account) to be used as a SQL Server login for connecting to SQL Server using Windows Authentication. The user does not have to specify a login when connecting to the instance of SQL Server. SQL Server uses the Windows account to validate the connection request.
Satya SKJ
Moderator
http://www.SQL-Server-Performance.Com/forum
This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
You should use sp_grantdbaccess instead of sp_adduser.
Don’t worry, satya, I mix both up, too. –Frank
http://www.insidesql.de

THanks for the correction Frank. Satya SKJ
Moderator
http://www.SQL-Server-Performance.Com/forum
This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
To be honest, I just remembered because I answered a similar question on the German MS newsgroup some days ago and had therefore a look at BOL. <br /><br />[<img src=’/community/emoticons/emotion-2.gif’ alt=’:D‘ />]<br /><br />–Frank<br /<a target="_blank" href=http://www.insidesql.de>http://www.insidesql.de</a><br />
]]>