How Do I Create a New User in a SQL Azure Database?

Had to look at a few different KB articles for this one so thought I'd throw all the steps together in one quick blog.

First you need to create a login, to do this, connect to the master database and run the following query:

  • CREATE LOGIN login1 WITH password='SuperSecretPassword';

Then connect to the Database you wish to give access to, you need to create the user, then supply the access.  Run the following scripts:

  • CREATE USER login1User FROM LOGIN login1;
  • EXEC sp_addrolemember 'db_owner', 'login1User';

Comments

Popular posts from this blog

SharePoint - Field type [FieldName] is not installed properly. Go to the list settings page to delete this field.

Office 365 Groups - Quickly find the GUID of a O365 Group

Export Group Membership From Active Directory Using Power Query