SitePoint Sponsor

User Tag List

Results 1 to 14 of 14
  1. #1
    SitePoint Addict certify's Avatar
    Join Date
    May 2001
    Location
    Malaysia
    Posts
    216
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    rename a table in asp

    can anyone show me how to rename a table in asp using sql statement....

    thanks
    Your WebHosting Partner - RouterWebHost.com
    eXam SIMulation Software - ExamSim.net
    geeks forums -ProgrammingTutor.com
    BMWClub of Malaysia - BMWClub.com.my
    unofficial MU Fan Club coming soon - ManchesterUnited.com.my


  2. #2
    SitePoint Addict certify's Avatar
    Join Date
    May 2001
    Location
    Malaysia
    Posts
    216
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the table i'm refering here is a database table.... ok....
    Your WebHosting Partner - RouterWebHost.com
    eXam SIMulation Software - ExamSim.net
    geeks forums -ProgrammingTutor.com
    BMWClub of Malaysia - BMWClub.com.my
    unofficial MU Fan Club coming soon - ManchesterUnited.com.my


  3. #3
    ALT.NET - because we need it silver trophybronze trophy dhtmlgod's Avatar
    Join Date
    Jul 2001
    Location
    Scotland
    Posts
    4,836
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I had a quick look about, and I couldn't find anything about it, so I'm not sure if you can.

  4. #4
    SitePoint Wizard
    Join Date
    Jan 2001
    Location
    Milton Keynes, UK
    Posts
    1,011
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not sure about Access but with SQL Server you can use the stored procedure sp_rename. I think it can be used with any object (ie table, sp, view constraint etc).


    sp_rename oldname, newname

  5. #5
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,121
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Don't think you can simply rename a table...

    However you could create a table, replicate the data then drop it...

    However I'll ask my compadre in crime
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  6. #6
    SitePoint Member
    Join Date
    Jun 2001
    Location
    kuala lumpur in malaysia
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hmmmm....... create a table and then drop the old table..... but in sql.... there is a command called rename.....

    rename table old-table to new-table........ also

    alter table old-table
    rename new-table

    but.... i don't know this will work or not....

    thanks....
    Helping you to get Certified!
    www.certifyexpress.com
    Ultimate Practice Exam!
    www.certifypro.com

  7. #7
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,121
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    the rename thing is NOT a standard SQL command (for tables)... sp_rename works in SQL Server, RENAME works in Oracle, etc.
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  8. #8
    Say WHA?! goober's Avatar
    Join Date
    Sep 2000
    Location
    United States
    Posts
    1,921
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I believe explainations are needed?

    Examples help too.
    Sean Killeen [LinkedIn] [Twitter] [Web]

    Warning: Reality.sys corrupted. Universe halted. Reboot? (Y/N)

  9. #9
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,121
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Okay, SQL is Standard Query Language.

    Problem is, it's not necessarily standard, the larger Database engines (RDBMS's) each have "extended" SQL commands.

    In SQL Server one of these is sp_rename.

    That good enough? *L*
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  10. #10
    ALT.NET - because we need it silver trophybronze trophy dhtmlgod's Avatar
    Join Date
    Jul 2001
    Location
    Scotland
    Posts
    4,836
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Uhm... doesn't SQL stand for Structured Query Language?


  11. #11
    SitePoint Member
    Join Date
    Jun 2001
    Location
    kuala lumpur in malaysia
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    doesn't sql has its own command for renaming a table.... i mean the standard one, since it can create table, alter table....

    why can't rename the table? just puzzled.....
    Helping you to get Certified!
    www.certifyexpress.com
    Ultimate Practice Exam!
    www.certifypro.com

  12. #12
    ALT.NET - because we need it silver trophybronze trophy dhtmlgod's Avatar
    Join Date
    Jul 2001
    Location
    Scotland
    Posts
    4,836
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why exactly do you want to rename a table anyway?

  13. #13
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,121
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Whoops... Structured *L* :shame:
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  14. #14
    SitePoint Addict certify's Avatar
    Join Date
    May 2001
    Location
    Malaysia
    Posts
    216
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    u know... it is good to know new things... u can shorten some codes by just using some commands that u didn't know it exist...
    Your WebHosting Partner - RouterWebHost.com
    eXam SIMulation Software - ExamSim.net
    geeks forums -ProgrammingTutor.com
    BMWClub of Malaysia - BMWClub.com.my
    unofficial MU Fan Club coming soon - ManchesterUnited.com.my



Bookmarks

Posting Permissions

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