DBAsupport.com Forums - Powered by vBulletin
Results 1 to 6 of 6

Thread: Question on the dependent objects and privileges when a table is renamed.

Hybrid View

  1. #1
    Join Date
    Dec 1999
    Posts
    217

    Question on the dependent objects and privileges when a table is renamed.

    Hi Guys,

    This is a very basic question but I need to get some facts clarified.
    I am renaming a table (first I created a table 'ABC_1', Populated that table with an 'insert into...' statement from the original table 'ABC', then I dropped the table 'ABC' and rename table 'ABC_1' to 'ABC'). In this process what happens to the dependent objects? The views, procs and triggers become invalid thus I need to recompile them. The synonyms stay the same. WHat happens to the privileges on the table? Do I need to regrant them? AM I missing anything that needs to be done.

    Thanks for your prompt response.

    -Chintzs

  2. #2
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092

    Re: Question on the dependent objects and privileges when a table is renamed.

    Originally posted by Chintz
    Do I need to regrant them?
    Did you grant them to ABC_1 yet?
    Jeff Hunter

  3. #3
    Join Date
    Dec 1999
    Posts
    217
    Nope. I have granted no privileges to ABC_1.

    -Chintzs

  4. #4
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    Then yes, you need to regrant them.
    Jeff Hunter

  5. #5
    Join Date
    Sep 2001
    Location
    Ohio
    Posts
    334

    Re: Question on the dependent objects and privileges when a table is renamed.

    Originally posted by Chintz
    Hi Guys,

    This is a very basic question but I need to get some facts clarified.
    I am renaming a table (first I created a table 'ABC_1', Populated that table with an 'insert into...' statement from the original table 'ABC', then I dropped the table 'ABC' and rename table 'ABC_1' to 'ABC'). In this process what happens to the dependent objects? The views, procs and triggers become invalid thus I need to recompile them. The synonyms stay the same. WHat happens to the privileges on the table? Do I need to regrant them? AM I missing anything that needs to be done.

    Thanks for your prompt response.

    -Chintzs
    If I remember correctly, triggers get dropped when you drop a table. They don't just go invalid. Well, I guess triggers assigned to other tables that reference table ABC will go invalid. But if you have a trigger on table ABC... it's gone. So you have to recreate it for table ABC_1.

    Jodie

  6. #6
    Join Date
    Dec 1999
    Posts
    217
    Thanks.

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