Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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)
share|improve this question
You could have typed this question, word for word, into Google and the first hit is an MSDN article containing your answer. – Ryan Ries Nov 14 '12 at 17:18
hi, Thank You :) – Gilad Bronshtein Nov 18 '12 at 6:09
up vote 2 down vote accepted

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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