Re: Insert a new field into a table?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



In article <14te741i3vuhcvs4mapai50t680cstdcp1@xxxxxxx>,
ironwoodcanyon@xxxxxxxxx says...
On Fri, 11 Jul 2008 07:46:01 -0700, "Steve Gerrard"
<mynamehere@xxxxxxxxxxx> wrote:

Martin wrote:
I posted this question over in the vb.database.dao newsgroup but
haven't gotten an answer yet; hoping someone here might be able to
shed some light on this.

What I would like to do is INSERT the new field at a specified place
in the list of existing fields. Is it possible to do this? If so, how?


I think in most database systems there is no provision for inserting a column in
the middle of a table, because in general, there is no need. It is customary to
specify the desired columns in the desired order in every Select query anyway.
The column order in the table is just a reflection of the order in which they
were added to the table, and has no other meaning or use.

In general, I would agree with you. In this case, the reason I want to
do this is that, in a couple of places in my program, I am updating
field values in a loop that steps through a series of fields in their
ordinal number sequence. Adding the new fields at the end of the list
completely trashes that logic.

I'll probably end up doing what I've done a couple of other times -
just delete the table and recreate it from scratch. (Of course, then I
lose any existing data).

Why? There's no reason you couldn't copy off the data and re-import it
after making your table mods. Or is that more work than the data is
worth?


--
/~\ The ASCII
\ / Ribbon Campaign
X Against HTML
/ \ Email!

Remove the ns_ from if replying by e-mail (but keep posts in the
newsgroups if possible).

.



Relevant Pages

  • Re: Insert a new field into a table?
    ... specify the desired columns in the desired order in every Select query anyway. ... The column order in the table is just a reflection of the order in which they ... and has no other meaning or use. ...
    (microsoft.public.vb.general.discussion)
  • Re: Insert a new field into a table?
    ... Martin wrote: ... specify the desired columns in the desired order in every Select query anyway. ... The column order in the table is just a reflection of the order in which they ...
    (microsoft.public.vb.general.discussion)
  • Re: Looking for NameOf() type of functionality.
    ... For example instead of having to specify the property name as a literal like ... The main reason I don't want to use literals is to reduce bugs if a ... Dont change the property name without fully refactoring all your code ... You could do this with reflection but what would be the point? ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: SQLParameter Question.
    ... Yeah, I've wondered if it may be faster to specify it. ... ADO.NET does reflection to find the type of object you pass it if you ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Simple Validation Questins
    ... decided to disregard, for whatever reason). ... You seem to have a routine agenda of reading something extra into everything that you disagree with, in order to enhance your disagreement...? ... specify a hyperlink-colour. ... Sometimes you see a link-colour in - let's say - orange and then the visited link-colour will be blue. ...
    (comp.infosystems.www.authoring.stylesheets)