Write a script to add user user to database adventureworks

Assignment Help Database Management System
Reference no: EM131299346

Assignment

SQL Server 2012 User Admin Tutorial

To Create User

There are two steps to create a user in SQL Server: create a login first, and then create a user. A valid login name is required to connect to an SQL Server instance. A login could be either of below.

A Windows login that has been granted access to SQL Server (username/password is kept by local OS or domain controller)
An SQL Server login, that is maintained within SQL Server (username/password is kept by SQL Server)
A login can have associated users in different databases, but only one user per database.

SQL Server and Windows Authentication Mode
CREATE LOGIN steve WITH PASSWORD='abc123';
CREATE USER steve FOR LOGIN [steve];

Windows Authentication Mode
CREATE LOGIN [cse1\steve] FROM WINDOWS;
CREATE USER steve FOR LOGIN [cse1\steve];

To allow user to connect to MS SQL Database
GRANT CONNECT TO steve;

To Remove User
To remove a user, use DROP. Users that own securables cannot be dropped from the database.
DROP USER steve;

A user can be disabled by revoking its CONNECT permission by executing
REVOKE CONNECT FROM steve;
Additional Reading

Managing Logins, Users, and Schemas How-to Topics https://msdn.microsoft.com/en-us/library/aa337552.aspx (Create schemas, create a login and create a database user)

Deliverables

Note: 1) Avoid using stored system procedure wherever possible. Example: use CREATE LOGIN instead of sp_addlogin see https://msdn.microsoft.com/en-us/library/ms173768.aspx

2) DO NOT USE GUI. You will not receive points if you use GUI.

D1. Create SQL Server login user1 - include the SQL script

D2. Set default database for user1 to AdventureWorks - include the SQL script

D3. Create user for login user1 in database AdventureWorks - include the SQL script

D4. Add permissions (see slides) for user1 to read and create tables in AdventureWorks and Insert rows. - include the SQL script and check user1's properties and provide a screenshots similar to one below.

D5. Perform following steps and answer questions - just include your answer in the deliverable.

Change type of authentication for MS SQL Server to Windows and SQL Server.

Right-click the Server and choose Properties. Under Security pick SQL Server and Windows Authentication mode

b) Restart MS SQL Server (not the computer) see below.

Disconnect and connect using SQL Server Authentication. Connect to SQL Server as user1. Try to select all products from Production.Product table (AdventureWorks database). What does the query return? How many rows were returned?

D6. As user1 create new table user1_table. - include the SQL code for creating and populating table.

testID
1234

D7. Disconnect and connect again using Windows Authentication Mode. Disable user1 login.- include the SQL script. Log off and logon using user1 login. - Describe what happened in the deliverable

D8. Logon using Windows Authentication Mode delete user1 SQL Server login.- include the SQL code used and explain what happened with table created in D6, user1_table.

D9. Use who2 procedure to find information about your own login. - include a screen shot.

Check system stored procedure in master database. Run who system procedure. You can find information about current Microsoft SQL Server users and processes. System Stored Procedures can be found under Programmability -> Storage Procedures

To run procedure you need to use following query:

execute procedure_schema.procedure_name

D10. Go to computer management and create user1 with password abc123. Grant user1 permission to login to SQL Server (It is Windows Integrated authentication) - include the SQL script for granting permission in the deliverable.

D11. Write a script to add user user1 to database AdventureWorks. Delete user user1 and login user1 - include the SQL script in the deliverable.

Reference no: EM131299346

Questions Cloud

Are these ratings biased or unreliable : The most popular restaurant. Each year the Zagat Survey lists the most popular restaurants in Los Angeles. In 2005, A.O.C. was ranked 5th but in 2004 it was ranked 31st. The Cheesecake Factory was ranked 7th in 2005 but was 2nd in 2004. Are these ..
Write a program which uses structure having indicated member : Write a program which uses a structure having the indicated member names to store the following data: The program will keep a list of three test scores for one student.
Describe a measurement process that you think is valid : Measuring physical fitness. You want to measure the "physical fitness" of college students. Give an example of a clearly invalid way to measure fitness. Then briefly describe a measurement process that you think is valid.
Calculate the owners break-even probability : Assume the league's reminder profits was $335 million. Assume costs of fan irritation from the lockout is equal to owners' next best alternative, calculate the owners'  break-even probability. Explain your results.
Write a script to add user user to database adventureworks : Write a script to add user user1 to database AdventureWorks. Delete user user1 and login user1 - include the SQL script in the deliverable.
Why the count of unemployed people is not a valid measured : Use these facts to explain why the count of unemployed people is not a valid measure of the extent of unemployment.
Identify factors that influence chief executive remuneration : Determine how this information can be used to identify the factors that influence chief executive remuneration - Univariate and bivariate analysis and discussion which looks at the possible determinants of CEO remuneration - Determine how this inform..
Influence of some actors on the world stage : Globalization has increased the influence of some actors on the world stage and decreased the influence of others. Of the five actors listed below, which ones have increased and which ones have decreased? Why? (Actors: states, IGOs, NGOs, MNCs, ne..
Government securities from a commercial bank : Using a required reserve ratio of 10% and assuming that the banks keep no excess reserves, which of the following scenarios produces a larger effect on the money supply?

Reviews

Write a Review

Database Management System Questions & Answers

  Create an employee database

Create a report that contains the above data - be sure to include a Hampton University logo in your report.

  What are the main activities that the business undertakes

What are the main activities that the business undertakes and where in the business are the crucial decisions made?

  Design a relational database so that it is at least in 3nf

Explain typical situations when denormalizing a table is acceptable. Provide one (1) example of denormalizing a database table to justify your response.

  Design a database for dgthot

You are to design a database for DGTHOT (Dax's Good Times House of Tutoring). The company offers its tutoring services to both individuals and companies.

  Write select statement that returns two columns

Write a SELECT statement that returns two columns: VendorName and PaymentSum, where PaymentSum is the sum of the PaymentTotal column.

  Prove-leaves of binary search tree are located in bottom

Examples for small n are given bellow, where a small square box represents an unsuccessful search. Prove that leaves of any binary search tree are located in the bottom two levels.

  Basic component of a database system

Which of the following is not a basic component of a database system? Which of the following terms is synonymous with "tuple"

  Characteristic of a database that has data redundancy

Explain one characteristic of a database that has data redundancy. Note: Redundancy in our context is not a good thing

  Problem on concept learning

Write an algorithm called \Find-G" to nd a maximally-general consistent hypothesis. You can assume the data will be noise-free and that the target concept is in the hypothesis space.

  Explain the phase standarized but customizable

Why do database rocessing and dcument processig need each other? -  Explain the phase standarized but customizable.

  List all the functional dependencies that this relation

Assume that the value of attribute Z of the last record in the relation is changed from z3 to z2. Now list all the functional dependenciesthat this relation instance satis?es.

  In the response to this forum note that you have

in the response to this forum note that you have successfully installed the product and what you experienced in the

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd