Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sql to rename a field

Status
Not open for further replies.

mattbold

Programmer
Oct 5, 2001
45
GB
hello,
thanks everyone who's helped me so far on here, you'll be pleased to know i have another question! :

can anyone please tell me the sql to use to rename a field in a table?

thanks,
matt
 
Are you looking to define access tables, or Non-Jet tables?


With Access tables you can do this with a Data Definition Query (this is one of the SQL specific queries) -- im not sure on the syntax -- But i know you have to write the query in SQL using the ALTER statement...
anyone know the full syntax?

If you're running this query on a non-Jet source, i.e SQL server or Oracle - you can run the same query as a pass-through query and let the server execute..


Hope this helps

Hiren

:eek:)
 
hi thanks for your help yes im doing it in access, ill have a go at what you said and see what happens!

cheers
matt
 
Before you do this, make sure that you understand the implications. If you change a field name in code, you must also change all queries, subcode, etc. Someone asked this before, and try as I might, I still can't understand why anyone would want to do this. Just give the field names logical, but generic names, and then in your reports / forms, you can call them whatever you want... "Alcohol is our friend, and it's about time we had more friends over."

Terry M. Hoey
 
i still cant work out how to do it!
it's all cool with the queries and subcode and stuff because they're already set up to cope with such things..

any more pointers anyone?

cheers,
matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top