Hi,
Is there any API SQL Server 2008 offers for .net application to create and grant access authorities? Thanks!
Hi,
Is there any API SQL Server 2008 offers for .net application to create and grant access authorities? Thanks!
T-SQL has CREATE USER and other related commands which can be used to create user and/or to GRANT various privileges. This can be invoked directly from ADO.
This works for SQL accounts, if you are using the "integrated" security model, you'll need to add new accounts at the level of the OS / Active Directory.
A .Net specific API for SQL administration is SMO. See Managing Users, Roles, and Logins. To create a new login you call the Login.Create method.