Question
Write a script in SQL that creates four login IDs based on the contents of a new table called NewLogins. CREATE TABLE NewLogins (LoginName varchar(128))
Write a script in SQL that creates four login IDs based on the contents of a new table called NewLogins.
CREATE TABLE NewLogins (LoginName varchar(128)) INSERT NewLogins VALUES ('BBrown'), ('CChaplin'), ('DDyer'), ('EEbbers')
Use dynamic SQL and a cursor to perform four actions for each row in this table: (1) create a login with a temporary password based on the first four letters of the login name followed by 99999; (2) set the default database to the AP database; (3) create a user for the login with the same name as the login; and (4) assign the user to the PaymentEntry role.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started