|
-
Dec 22nd, 2000, 01:42 PM
#1
Thread Starter
Member
How, using SQL, do you insert a new field into a table in an Access database which already exists without deleting the table and creating a new one?
-
Dec 22nd, 2000, 02:18 PM
#2
Monday Morning Lunatic
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Dec 23rd, 2000, 09:48 AM
#3
Thread Starter
Member
How exactly do you use ALTER TABLE?
-
Dec 23rd, 2000, 11:53 AM
#4
Monday Morning Lunatic
This is from the documentation:
Code:
ALTER [IGNORE] TABLE tbl_name alter_spec [, alter_spec ...]
alter_specification:
ADD [COLUMN] create_definition [FIRST | AFTER column_name ]
or ADD [COLUMN] (create_definition, create_definition,...)
or ADD INDEX [index_name] (index_col_name,...)
or ADD PRIMARY KEY (index_col_name,...)
or ADD UNIQUE [index_name] (index_col_name,...)
or ALTER [COLUMN] col_name {SET DEFAULT literal | DROP DEFAULT}
or CHANGE [COLUMN] old_col_name create_definition
or MODIFY [COLUMN] create_definition
or DROP [COLUMN] col_name
or DROP PRIMARY KEY
or DROP INDEX index_name
or RENAME [AS] new_tbl_name
or table_options
So to add a field:
Code:
ALTER TABLE <table> ADD COLUMN (<type>)
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Dec 24th, 2000, 10:01 AM
#5
Thread Starter
Member
cheers
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|