On the ever-so-cludgy MS developer site, it says you can do the following:
ALTER TABLE (Mickey)
ADD Minnie_Text Varchar(20) Null;
Works fine, but I'd like to add multiple fields and supposedly you can do:
ALTER TABLE (Mickey)
ADD ( Minnie_Text Varchar(20) Null,
Pluto_Text Varchar(20) Null);
However, the second one doesn't work. It either errors out at the first parens or it doesn't like the comma. Now I don't mind copy/pasting and running through the table multiple times because, well, it is a one-time event. I'm just wondering what could be wrong with the second statement.
Alter Table woes
-
- 4StarLounger
- Posts: 453
- Joined: 04 Feb 2010, 03:40
Alter Table woes
When one cat leaves, another mysteriously shows up.
-
- 5StarLounger
- Posts: 847
- Joined: 24 Jan 2010, 06:35
- Location: A Magic Forest in Deepest, Darkest, Kent
Re: Alter Table woes
Peggy
I used this syntax in Access2K3 and it worked fine
I used this syntax in Access2K3 and it worked fine
Code: Select all
ALTER TABLE Mickey
ADD
Minnie_Text Varchar(20) Null,
Pluto_Text Varchar(20) Null;
Jerry
I’ll be more enthusiastic about encouraging thinking outside the box when there’s evidence of any thinking going on inside it
I’ll be more enthusiastic about encouraging thinking outside the box when there’s evidence of any thinking going on inside it
-
- Administrator
- Posts: 78574
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Alter Table woes
Try it without the parentheses:
ALTER TABLE Mickey
ADD Minnie_Text Varchar(20) Null,
Pluto_Text Varchar(20) Null;
Oops - I was held up while replying. Jezza came up with the same SQL.
ALTER TABLE Mickey
ADD Minnie_Text Varchar(20) Null,
Pluto_Text Varchar(20) Null;
Oops - I was held up while replying. Jezza came up with the same SQL.
Best wishes,
Hans
Hans
-
- 4StarLounger
- Posts: 453
- Joined: 04 Feb 2010, 03:40
Re: Alter Table woes
Oh...Okay. So my handy dandy sql book is wrong too.
Thanks Jerry and Hans! I don't know what I'd do without you guys. Well, probably a lot but you know....
Thanks Jerry and Hans! I don't know what I'd do without you guys. Well, probably a lot but you know....
When one cat leaves, another mysteriously shows up.
-
- 5StarLounger
- Posts: 847
- Joined: 24 Jan 2010, 06:35
- Location: A Magic Forest in Deepest, Darkest, Kent
Re: Alter Table woes
I have a feeling the author was probablya mySQL developer at some stage as the sintax is very similargarbsmj wrote:Oh...Okay. So my handy dandy sql book is wrong too.
Thanks Jerry and Hans! I don't know what I'd do without you guys. Well, probably a lot but you know....
Jerry
I’ll be more enthusiastic about encouraging thinking outside the box when there’s evidence of any thinking going on inside it
I’ll be more enthusiastic about encouraging thinking outside the box when there’s evidence of any thinking going on inside it