> Before I spend too long looking, does anyone know if its
> possible to ALTER TABLE and insert a field in other than the
> last ordinal_position???
> This query adds a column in the last position..
> <cfquery name="addfield" datasource="#default_datasource#">
> ALTER TABLE #table# ADD #form.column_name#
> #form.type_name#<cfif #form.type_name# is
> "varchar">(#form.length#)</cfif> #null#
> </cfquery>
> like so.
> column1
> column2
> the new column is added here
>
> I want...
> column1
> Insert a column here
> column2
To the best of my knowledge, this is impossible. In any case, the ordinal
position of a field within a table is irrelevant within SQL, which is a
set-based language. You can reformat and reorder the output however you
like.
If for some reason you absolutely insist on rearranging your table
structure, the typical process for this is to create a temp table, copy the
data to the temp table, drop any relations on the original table, drop the
original table, recreate the table the way you want it, recreate the
relations, copy the data from the temp table to the new table, then drop the
temp table. Rereading this sentence, I understand why I like ERWin.
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists