rename column name

This is a discussion on "rename column name" within the Databases section. This forum, and the thread "rename column name are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > Databases

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Nov 10th, 2005, 18:10
Junior Member
Join Date: May 2005
Location: bath - england
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
rename column name

I'm having trouble updating a database column name. What's wrong with this:

sql="ALTER TABLE products RENAME COLUMN product_id to prod_id"
objconn.execute(sql)

I'm using classic ASP with an access database. Is it not possible to update column names with access databases?

I get an error message saying that there is a syntax error in the sql.
Reply With Quote

  #2 (permalink)  
Old Nov 10th, 2005, 19:14
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,952
Blog Entries: 7
Thanks: 7
Thanked 4 Times in 4 Posts
Send a message via MSN to Rob Send a message via Skype™ to Rob
Re: rename column name

This *may* work
Code: Select all
Mydb.TableDefs("OldTable").Name="NewTable"
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
Reply With Quote
  #3 (permalink)  
Old Nov 11th, 2005, 00:08
Anonymous User
Guest
Posts: n/a
Re: rename column name

Don't know about Access, in MS SQL Server you would use a system stored procedure.

Here is a link that seems relevant....

http://forums.microsoft.com/MSDN/Sho...25996&SiteID=1
Reply With Quote
Reply

Tags
rename, column, name

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Clone Select - Rename not working in IE Awok JavaScript Forum 1 Jan 9th, 2008 17:22
How can I add in a 3rd column in on the right like the one on the left ? nizmotine Web Page Design 7 Aug 13th, 2007 12:28
Forum Rename JacobHaug Flash & Multimedia Forum 3 May 27th, 2007 19:51
..copy data from column A in Table A to column B in Table B? gecastill Databases 10 Jun 23rd, 2005 18:27


All times are GMT. The time now is 09:29.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43