LAB7_SICARD - IT 3233 Database Design and Implementation...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
IT 3233 – Database Design and Implementation Lab – SQL Server Security Dr. Cheryl Aasheim TO GET STARTED 1. Download the file with the sample database from Georgia View. 2. Attach the sample database 3. Login to SQL Server, right-click the server name, click on security, then click SQL Server Authentication 4. On the start menu, click on SQL Server Configuration Manager, then click SQL Server Services, right-click SQL Server (MSSSQLESERVER) and restart the server. 5. RENAME the database in SQL Server (not in Windows), by right-clicking it in Object Explorer. The name should be lastname_sample.mdf, where lastname is your last name. 6. You might want to keep all of your SQL statements in a Word document in case you don’t finish and need to start over. PERFORM THE FOLLOWING ACTIVITIES 1. Create trigger Create a trigger called tr_change_budget that logs every change of the budget in the project table. Include the old budget, the new budget, the project number, the user that made the change and the date the change was made in the audit table. CREATE TRIGGER tr_change_budget ON Project AFTER UPDATE AS IF UPDATE ( budget ) BEGIN DECLARE @project_no char ( 4 ) DECLARE @budget_old float DECLARE @budget_new float SELECT @project_no = ( SELECT project_no FROM INSERTED ) SELECT @budget_old = ( SELECT budget FROM DELETED ) SELECT @budget_new = ( SELECT budget FROM INSERTED ) INSERT INTO audit_table VALUES ( @project_no , @budget_old , @budget_new , GETDATE (), USER_NAME ()) END 2. Add users to the sample DB
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/13/2012 for the course IT 3233 taught by Professor Aashiem during the Fall '11 term at Georgia Southern University .

Page1 / 5

LAB7_SICARD - IT 3233 Database Design and Implementation...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online