Question: Write a script that uses dynamic SQL and a cursor to loop through each row of the Administrators table and (1) create a login ID
Write a script that uses dynamic SQL and a cursor to loop through each row of the Administrators table and
(1) create a login ID for each row in that consists of the administrators first and last name with no space between; (2) set a temporary password of temp for each login; (3) set the default database for the login to the MyGuitarShop database; (4) create a user for the login with the same name as the login; and (5) assign the user to the OrderEntry role.
This is what the Administrators table looks like:

Results & Messages Admin|D EmailAddress Password FirstName LastName 2 2-aam@rmurayguitarshop.com admin@myguitarshop .com 6a718fbd768e2378b511f8249b5489940e9022 Admin User wie joel @murach .com 971e95957d3b74d70d79c20c94e9cd91b85f7aae Joel Murach mike @murach .com 5f2975c819cefc686282456aeae3a137bf896ee8 Mike Murach 123
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
