How do i Create sql login user with using QUERY? I would like to use the following parameters.

  1. User Name = campus
  2. User's Password = 123
  3. Policy = OFF
  4. Default Language = English
  5. Default Database = VM1
  6. Server Role = Public
  7. User Mapping = V checked on my database name (VM1)

Microsoft SQL Server:

use VM1
create login campus With PASSWORD='123', DEFAULT_LANGUAGE=english, check_policy=off, default_database=VM1
Create user campus for Login campus

The public role on server is created by default.

Creating the user on the database will map that database to the Server login.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.