Lab 2 Install SQL Server
Lab 2 Install SQL Server
I. Downloading SQLServer.
The official download site for the latest SQLServer is:
https://www.microsoft.com/en-us/sql-server/sql-server-downloads
II. Installing and configuring.
Installing and configuring on Windows:
Step 1: Run Installed Application
Navigate to the directory/folder where you downloaded the application then
double-click it to start the installation process.
Step 17
Download and install SSMS Release 18
Version 18.3 or later
Step 18
It gives below message to restart the system to complete setup
Step 19
Try to Connect to SQL Server 2019
Advantages & Disadvantages of Microsoft SQL.
a. Advantages
Common: Microsoft is supported a lot because the Windows operating system is widely
used in enterprise systems
Interface support: User friendly, MS SQL Server comes with an impressive set of tools.
Components like SQL Server Profiler, SQL Server Management Studio, BI tools, and
Database Tuning Advisor can save you a lot of troubleshooting, development, and
administration time. In addition, as a core product in Microsoft's technology arsenal, MS
SQL Server has a wealth of documentation and support.
Separate security privileges.
Maintain backup servers. Easily backup and prepare for problems.
Excellent data recovery support: Corrupted data is always a concern when power outages
or improper shutdowns occur. Microsoft SQL Server has a number of features that
promote data recovery and recovery. Although individual tables cannot be backed up or
restored, complete database recovery options are available. Through the use of log files,
caching, and backups, Microsoft products allow you to feel confident that disaster
recovery options are rich.
b. Disadvantage
Request machine configuration when installing.
Limited Compatibility: Microsoft SQL Server runs only on Windows operating systems.
Cost: Microsoft SQL Server needs to pay a license fee to run multiple databases. The
SQL Server Datacenter edition is $54,990 per processor.
SQL SERVER 2019 ADMINTRATOR
Using query to modify user
Create user to login
Step1: Open new query page with File > New > Query with current connection ( or press
ctrl + N)
Use [University]
IF EXISTS (SELECT Name FROM sysusers WHERE NAME='Priv1')
BEGIN
DROP USER Priv1
END
CREATE USER [Priv1] for LOGIN Teacher1
Step7:
Insert new row in table:
INSERT INTO Class1(classID, classRoom)
VALUES ('IA14A', '115')
INSERT INTO Class2(classID, classRoom)
VALUES ('IA14B', '117')
Step 8:
Update on SQL Server with existing value:
User
SCHOOL
Class 1 Class 2
1. Login to SQL Server Management Studio
Result
2. Right-click Teacher1 and select Properties. The screen below will appear
3. Choose User Mapping and select Database for User. Then select the authority
you want to grant that user in the last box.
4. Do the same for Teacher2 and Teacher3.
IV. Decentralization in Table
1. Decentralized for table. Select the table you want to assign and click
properties
2. The dialog box pops up as follows. Click on search.
3. Check the user you want to grant permission and click ok to appy.
4. Grant the FRS401 read-only permission to teacher1 and block the right to view
information with teacher3.
5. Grant control for Teacher2
6. Sign out and try to log in again with each account.
7. Result
Code Python To Connect
import pyodbc