I want to create an Sql Server Authentication Account, not a user in the database or in the account.
What i mean is that i want to create an account so i can login from it when i start the sql server, using SQL Transaction or using C#.
I want to create an Sql Server Authentication Account, not a user in the database or in the account.
What i mean is that i want to create an account so i can login from it when i start the sql server, using SQL Transaction or using C#.
There are only two modes that I know you can use: Windows or SQL Server Authentication. This means you are limited to only two choices: You either use a Windows account, or you create an SQL Server login that you can use to authenticate.
EDIT:
To programmatically create an sql server login, you could use Sql Server Management objects. I notice you didn't say whether you want to do this from a Windows (desktop) or Web application. To use Sql Server Management to create a login (or do any sort of "management"), the code would need to run with higher privileges - say local or domain account with sufficient privileges to administer the SQL server instance.
You will need to add references to (you could use version 9.0 of the assemblies):
With that, the following code is enough to create an SQL login and also add the user to your target database
You will need to add:
You can add try{} catch{} blocks and plumbing code to make it more robust you would recover gracefully in case of failure