Drop Foreign Keys
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: Drop Foreign Keys

  1. #1
    Join Date
    Sep 2000
    Posts
    155

    I have 2 users in the database, userA and userB.
    UserB has the DML priviliges (SELECT, INSERT, UPDATE, DELETE) for all the tables under userA.

    I was wondering if the userB can have DROP and CREATE FOREIGN KEYs of userA. If YES, what would be right GRANT command???

    The reason is, for some cases in our application, userB has to delete certain data and to make FKs error simple, we want to DROP FKs, Delete the data, Insert new data, and re-create FKs.

    Thanks in advance!


  2. #2
    Join Date
    Feb 2001
    Location
    Bangalore, India
    Posts
    109
    There is a grant "References". This can be given so that other user can create foreign keys

  3. #3
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    Why even have FK's if you are going to delete them to do your operation?
    Jeff Hunter
    marist89@yahoo.com
    http://marist89.blogspot.com/
    Get Firefox!
    "I pledge to stop eating sharks fin soup and will not do so under any circumstances."

  4. #4
    Join Date
    Sep 2000
    Posts
    155
    sln81,

    I would appreciate if you could give me the GRANT privilige
    statement that you are talking about. I do not have access
    to the docs from here.


  5. #5
    Join Date
    Feb 2000
    Location
    Washington DC
    Posts
    1,843
    To grant BLAKE the REFERENCES privilege on the EMPNO column and the UPDATE privilege on the EMPNO, SAL, and COMM columns of the EMP table in the schema SCOTT, issue the following statement:

    GRANT REFERENCES (empno), UPDATE (empno, sal, comm)
    ON scott.emp
    TO blake;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width