473,508 Members | 4,753 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Updating Field Names in Tables using data definition query?

1 New Member
Is it even remotely possible to update field names to the correct field name for the same table using a data definition query? We have a utility that spits out data in an Access database for use in reporting (can't really go into too much detail...it's a legal application). Anyway, I always have to customize the field names every single time a production is to go out. The original field names are always the same, and the field names I want to change them to are always the same on a case by case basis. I would love to figure out how to customize the query so that it automatically updates the field names...this would cut down a lot of time spent on changing each field name individually.

And yes, I am inexperienced in SQL but I can understand the logic when reading the statements (I just can't spit out the lingo).

TIA,
Jacey
Jul 18 '08 #1
1 4659
Stewart Ross
2,545 Recognized Expert Moderator Specialist
In your circumstances I would devise queries which alias the fields concerned, giving them the names you want them to have, then use these for export/reporting/further processing.

Place a table on the Access Query Editor grid then add some fields to the grid. You can use alternate names for the fields (known as aliasing) by providing the new name for the field where the existing name shows on the grid, like this:
Expand|Select|Wrap|Line Numbers
  1. Preferred Name: Old Name
In the underlying SQL itself aliasing is done using the As operator:

Expand|Select|Wrap|Line Numbers
  1. SELECT [Old name] AS [Preferred Name], [Another hard to read one] AS [Easily Read Name], ... , 
  2. FROM [Your table]
  3. WHERE somecondition holds
  4. ORDER BY some field
As for replacing field names automatically - wouldn't recommend that you interfere with table definitions, although it is technically possible. Use an aliased query instead.

There are other approaches, such as using mapping tables to map one field to another, but these would require a lot of thought about what you want to do and how you want to do it.

I think you can achieve a lot simply by renaming the fields in suitable queries that you can set up for specific purposes.

-Stewart
Jul 19 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
35803
by: Thierry B. | last post by:
Hi, from SQL*Plus, i use: DESCRIBE MyTable and I get this result (example): Nom NULL ? Type ----------------------------------------- --------...
2
1954
by: Eric G | last post by:
Hello, I'm using A2K and would like to update our school back-end server file. I've taken a copy of it home because I was having some trouble updating it at school. I basically want to add...
13
3492
by: John young | last post by:
I have been looking for an answer to a problem and have found this group and hope you can assist . I have been re doing a data base I have made for a car club I am with and have been trying to...
1
1850
by: Chris Jackson | last post by:
I'm a novice Access user and am not sure how to solve the following problem. Any help with the following would be greatly appreciated! I have two tables with identical structures, the first holds...
1
2695
by: rdemyan via AccessMonster.com | last post by:
My App has 10 or so tables that we provide that contains proprietary data. This data will need to be updated once or twice a year. I would like some comments, suggestions on my proposed strategy...
9
3095
by: sellcraig | last post by:
Microsoft access 2 tables table "data main" contains a field called "code" table "ddw1" is created from a make table query of "data main" Goal- the data in "code" field in needs to...
5
1963
by: JimmyKoolPantz | last post by:
Situation: I am writing a program that opens up a data file (file ext .dbf), imports the information into a dataset. The program also, searches through the dataset for key words ("company...
11
10273
by: Tim Hunter | last post by:
Hi I am using WinXP and Access 2003 Is it possible to store the field names of a table in an array and then loop through the array and update the table using the field names stored in the array? I...
4
8852
by: dreaken667 | last post by:
I have a MySQL database containing 16 tables of data. Each table has a different number of columns and there are few common field names accross tables. I do have one master table with which I connect...
0
7228
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7502
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5635
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4715
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3206
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3191
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1565
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
426
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.