Differences between revisions 2 and 3
Revision 2 as of 2018-01-25 20:24:25
Size: 393
Editor: scot
Comment:
Revision 3 as of 2020-02-05 13:32:04
Size: 466
Editor: scot
Comment:
Deletions are marked like this. Additions are marked like this.
Line 6: Line 6:
USE DELETEME; CREATE LOGIN DELETEME WITH PASSWORD='HelloJunkBonds123'; CREATE USER DELETEME FOR LOGIN DELETEME WITH DEFAULT_SCHEMA=[db_owner]; EXEC sp_addrolemember 'db_owner', 'DELETEME'; USE DELETEME;
CREATE LOGIN DELETEME WITH PASSWORD='HelloJunkBonds123';
CREATE USER DELETEME FOR LOGIN DELETEME WITH DEFAULT_SCHEMA=[db_owner];
EXEC sp_addrolemember 'db_owner', 'DELETEME';
Line 9: Line 12:
Above is the T-SQL needed to add a database. We'll create the scripts based on the usernames in Excel. Above is the T-SQL needed to add a database. We'll create the scripts based on the usernames in Excel. Yes, you can put the last three lines on one line when using excel.

Creating Student Databases Script in SQL

CREATE DATABASE DELETEME; 
GO 
USE DELETEME; 
CREATE LOGIN DELETEME WITH PASSWORD='HelloJunkBonds123'; 
CREATE USER DELETEME FOR LOGIN DELETEME WITH DEFAULT_SCHEMA=[db_owner]; 
EXEC sp_addrolemember 'db_owner', 'DELETEME';

Above is the T-SQL needed to add a database. We'll create the scripts based on the usernames in Excel. Yes, you can put the last three lines on one line when using excel.

DatabaseManagementSystems/CreateStudentDatabasesSql (last edited 2020-02-05 13:32:04 by scot)