rename a table in asp
can anyone show me how to rename a table in asp using sql statement....
thanks
the table i'm refering here is a database table.... ok....
I had a quick look about, and I couldn't find anything about it, so I'm not sure if you can.
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
32,817
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
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....
32,817
the rename thing is NOT a standard SQL command (for tables)... sp_rename works in SQL Server, RENAME works in Oracle, etc.
I believe explainations are needed?
Examples help too.
Sean Killeen [
LinkedIn ] [
Twitter ] [
Web ]
Warning: Reality.sys corrupted. Universe halted. Reboot? (Y/N)
32,817
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*
Uhm... doesn't SQL stand for Structured Query Language?
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.....
Why exactly do you want to rename a table anyway?
32,817
Whoops... Structured *L* :shame:
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...
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Bookmarks