0
how to create a new column in an existing table without uploading a new db file
Participant
,
/t5/coldfusion-discussions/how-to-create-a-new-column-in-an-existing-table-without-uploading-a-new-db-file/td-p/14671
Oct 14, 2006
Oct 14, 2006
Copy link to clipboard
Copied
hi there, i often find myself needing to add new columns to a
table. currently i choose a quiet time of day, download the db from
my live server, quickly open it up and add in my new column, then
upload it back to the live server - whilst hoping that none of my
visitors a) changed anything during this process and b) that no one
exeperinced any errors
..not ideal!
is there a way to create new columns in tables (and even to create new tables perhaps) via CF so i dont have to do this downloading / uploading procedure to my mdb documnet (i'm using an access database by the way)
i'm thinking something like this??...
<cfquery datasource="blah">
CREATE COLUMN name="new_variable" type="yes/no"...?
</cfquery>
is there such a thing? thank you very much indeed for any assistance you can provide.
..not ideal!
is there a way to create new columns in tables (and even to create new tables perhaps) via CF so i dont have to do this downloading / uploading procedure to my mdb documnet (i'm using an access database by the way)
i'm thinking something like this??...
<cfquery datasource="blah">
CREATE COLUMN name="new_variable" type="yes/no"...?
</cfquery>
is there such a thing? thank you very much indeed for any assistance you can provide.
TOPICS
Getting started
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Engaged
,
/t5/coldfusion-discussions/how-to-create-a-new-column-in-an-existing-table-without-uploading-a-new-db-file/m-p/14672#M1511
Oct 14, 2006
Oct 14, 2006
Copy link to clipboard
Copied
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Nick Way
AUTHOR
Participant
,
/t5/coldfusion-discussions/how-to-create-a-new-column-in-an-existing-table-without-uploading-a-new-db-file/m-p/14673#M1512
Oct 14, 2006
Oct 14, 2006
Copy link to clipboard
Copied
hi Simon - thanks for your reply.
naturally i did try google, i tried searching for "coldfusion add column access" and "how to add a column coldfusion" etc - i've also trawled the macromedia knowledge base
i have now tried again searching for "alter table" etc but unfortunatley i am still none the wiser
having read the page you suggested i have tried a few differnent ways of implementing their suggestion - but alas my computer says no..
Error Executing Database Query.
Syntax error in ALTER TABLE statement.
The error occurred in C:\CFusionMX7\wwwroot\nyalocal\admin\testcolumn.cfm: line 1
<cfquery datasource="nya" >
ALTER TABLE tbl_shoots-few ADD city text
</cfquery>
if you or anyone else could please help i'd be very grateful indeed. thank you
naturally i did try google, i tried searching for "coldfusion add column access" and "how to add a column coldfusion" etc - i've also trawled the macromedia knowledge base
i have now tried again searching for "alter table" etc but unfortunatley i am still none the wiser
having read the page you suggested i have tried a few differnent ways of implementing their suggestion - but alas my computer says no..
Error Executing Database Query.
Syntax error in ALTER TABLE statement.
The error occurred in C:\CFusionMX7\wwwroot\nyalocal\admin\testcolumn.cfm: line 1
<cfquery datasource="nya" >
ALTER TABLE tbl_shoots-few ADD city text
</cfquery>
if you or anyone else could please help i'd be very grateful indeed. thank you
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Engaged
,
/t5/coldfusion-discussions/how-to-create-a-new-column-in-an-existing-table-without-uploading-a-new-db-file/m-p/14674#M1513
Oct 15, 2006
Oct 15, 2006
Copy link to clipboard
Copied
What database are you using?
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Nick Way
AUTHOR
Participant
,
/t5/coldfusion-discussions/how-to-create-a-new-column-in-an-existing-table-without-uploading-a-new-db-file/m-p/14675#M1514
Oct 15, 2006
Oct 15, 2006
Copy link to clipboard
Copied
hi Simon
I am using Access
I am using Access
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
/t5/coldfusion-discussions/how-to-create-a-new-column-in-an-existing-table-without-uploading-a-new-db-file/m-p/14676#M1515
Oct 15, 2006
Oct 15, 2006
Copy link to clipboard
Copied
> I am using Access
http://www.blueclaw-db.com/alter_table_ddl.htm
> naturally i did try google, i tried searching for "coldfusion add column
> access" and "how to add a column coldfusion" etc - i've also trawled the
> macromedia knowledge base
When looking up how to do things to your DB, it's probably an idea to omit
"ColdFusion" from the search string. It's irrelevant: CF passes all DB
instructions straight to the DB driver / engine, so it doesn't actually
play any part in the specific solution: it's just the messenger.
--
Adam
http://www.blueclaw-db.com/alter_table_ddl.htm
> naturally i did try google, i tried searching for "coldfusion add column
> access" and "how to add a column coldfusion" etc - i've also trawled the
> macromedia knowledge base
When looking up how to do things to your DB, it's probably an idea to omit
"ColdFusion" from the search string. It's irrelevant: CF passes all DB
instructions straight to the DB driver / engine, so it doesn't actually
play any part in the specific solution: it's just the messenger.
--
Adam
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Nick Way
AUTHOR
Participant
,
/t5/coldfusion-discussions/how-to-create-a-new-column-in-an-existing-table-without-uploading-a-new-db-file/m-p/14677#M1516
Oct 15, 2006
Oct 15, 2006
Copy link to clipboard
Copied
ok thanks Adam I appreciate the tip
so in order to implement this solution then do it wrap this up in cfquery tags then?
like this..
<cfquery datasource="blah">
ALTER TABLE Employees ADD COLUMN Emp_Email TEXT(25);
</cfquery>
also do you know what the correct syntax is to add a yed/no field for an access database by any chance please?
thanks very much for your help i really appreciate it - this is a subject that doesnt seem to be documented anywhere 😞
so in order to implement this solution then do it wrap this up in cfquery tags then?
like this..
<cfquery datasource="blah">
ALTER TABLE Employees ADD COLUMN Emp_Email TEXT(25);
</cfquery>
also do you know what the correct syntax is to add a yed/no field for an access database by any chance please?
thanks very much for your help i really appreciate it - this is a subject that doesnt seem to be documented anywhere 😞
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Nick Way
AUTHOR
Participant
,
LATEST
/t5/coldfusion-discussions/how-to-create-a-new-column-in-an-existing-table-without-uploading-a-new-db-file/m-p/14678#M1517
Oct 15, 2006
Oct 15, 2006
Copy link to clipboard
Copied
ah ha!! - it seems that on this occasion trial and error (as
well as the trusty cf forum) was my friend..
in case anyone else finds themselves trying to do what i was doing i now have the following...
<cfquery datasource="blah" >
ALTER TABLE tbl_fred ADD varA BIT
</cfquery>
or (if you want to add a number column to your access db)..
<cfquery datasource="blah" >
ALTER TABLE tbl_fred ADD varB NUMBER
</cfquery>
thanks for your helps chaps
in case anyone else finds themselves trying to do what i was doing i now have the following...
<cfquery datasource="blah" >
ALTER TABLE tbl_fred ADD varA BIT
</cfquery>
or (if you want to add a number column to your access db)..
<cfquery datasource="blah" >
ALTER TABLE tbl_fred ADD varB NUMBER
</cfquery>
thanks for your helps chaps
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

