PL-SQL
Oracle PL/SQL Object Types Tutorial with EXAMPLES
What is Object Type in PL/SQL? Object-Oriented Programming is especially suited for building...
In this tutorial, you will learn
To create a login, Navigate to Security > Logins
In the next screen, Enter
Login is created
You can also create a login using the T-SQL command.
CREATE LOGIN MyLogin WITH PASSWORD = '123';
A user is an account that you can use to access the SQL server. To create users, you can use any of the following two ways:
You will be creating a user for the EDU_TSQL database.
You will get the following screen,
User is created
You can create a new USER using the T-SQL's create user command. The command takes the following syntax:
create user <user-name> for login <login-name>
create user gtupapers for login MyLogin
Note: That the query should be executed within the query window. If a user is already created for a Login, SQL Server will throw an error if you create a user for the same login.
Permissions refer to the rules that govern the levels of access that users have on the secured SQL Server resources. SQL Server allows you to grant, revoke and deny such permissions. There are two ways to assign permissions in SQL Server:
Step 1) Connect to your SQL Server instance and expand the folders from the Object Explorer as shown below. Right click on the name of the user, that is, gtupapers then choose Properties.
Step 2) In the next screen,
Step 3) In the next window,
Step 4)
Step 5) The user gtupapers is granted SELECT permission on table Course.
To grant permission to a user using T-SQL, you first select the database using the use statement. You then assign the permission to the user using the grant statement. Here is the syntax:
use <database-name> grant <permission-name> on <object-name> to <username\principle>
For example, the following command shows how you can grant the select permission to the user gtupapers on the object (table) named Course within the Database EDU_TSQL:
USE EDU_TSQL GO Grant select on Course to gtupapers
The permission will be granted!
What is Object Type in PL/SQL? Object-Oriented Programming is especially suited for building...
In this tutorial, we are going to learn how to use SQL in PL/SQL. SQL is the actual component that...
SQL Tutorial Summary Databases can be found in almost all software applications. SQL is the...
What are TCL Statements in PL/SQL? TCL stands for Transaction Control Statements. It will either save...
$20.20 $9.99 for today 4.5 (108 ratings) Key Highlights of PL/SQL Tutorial PDF 188+ pages eBook...
Sorting Results Using the SELECT command, results were returned in the same order the records were...