منتدى أحلـــى كـــلام
عزيزى الزائر

كونك زائر غير مسجل

* سيتم عرض اعلانات لك، هذه الاعلانات لا تظهر للاعظاء.
* لن تتمكن من مشاهدة بعض محتويات مواضيعنا.

ندعوك للتسجيل بأقل من دقيقة
* لتتمكن من مشاهدة كافة محتويات المواضيع التى ترغب فى قرآئتها .
* وقف عرض الاعلانات.

SiteAdmin

revoke and Grant command

استعرض الموضوع السابق استعرض الموضوع التالي اذهب الى الأسفل

revoke and Grant command

مُساهمة من طرف SiteAdmin في الخميس يناير 06, 2011 4:49 pm



SQL GRANT Command


SQL GRANT is a command used to provide access or privileges on the database objects to the users.
The Syntax for the GRANT command is:
GRANT privilege_name
ON object_name
TO {user_name |PUBLIC |role_name}
[WITH GRANT OPTION];


  • privilege_name is the access right or privilege granted to the user. Some of the access rights are ALL, EXECUTE, and SELECT.
  • object_name is the name of an database object like TABLE, VIEW, STORED PROC and SEQUENCE.
  • user_name is the name of the user to whom an access right is being granted.
  • user_name is the name of the user to whom an access right is being granted.
  • PUBLIC is used to grant access rights to all users.
  • ROLES are a set of privileges grouped together.
  • WITH GRANT OPTION - allows a user to grant access rights to other users.

For Eample: GRANT SELECT ON employee TO user1;This command grants a SELECT permission on employee table to user1.You should use the WITH GRANT option carefully because for example if you GRANT SELECT privilege on employee table to user1 using the WITH GRANT option, then user1 can GRANT SELECT privilege on employee table to another user, such as user2 etc. Later, if you REVOKE the SELECT privilege on employee from user1, still user2 will have SELECT privilege on employee table.
SQL REVOKE Command:


The REVOKE command removes user access rights or privileges to the database objects.
The Syntax for the REVOKE command is:
REVOKE privilege_name
ON object_name
FROM {user_name |PUBLIC |role_name}

For Eample: REVOKE SELECT ON employee FROM user1;This commmand will REVOKE a SELECT privilege on employee table from user1.When you REVOKE SELECT privilege on a table from a user, the user will not be able to SELECT data from that table anymore. However, if the user has received SELECT privileges on that table from more than one users, he/she can SELECT from that table until everyone who granted the permission revokes it. You cannot REVOKE privileges if they were not initially granted by you.

_________________
Best Regards
Site Administrator
avatar
SiteAdmin
Admin
Admin

عدد المساهمات : 333
نقاط : 2040
تقييم العضو : 6
تاريخ التسجيل : 09/06/2010
العمر : 43
الموقع : Banker

http://ahlakalam.to-relax.net

الرجوع الى أعلى الصفحة اذهب الى الأسفل

استعرض الموضوع السابق استعرض الموضوع التالي الرجوع الى أعلى الصفحة


 
صلاحيات هذا المنتدى:
لاتستطيع الرد على المواضيع في هذا المنتدى