Alter Query
-
Hi I use this
ALTER TABLE table_name
ADD column_name datatypeto add column in table. How to use Alter Query to add column in query? I use MS Access 2003.
-
You can't add it. Depends on what you mean by 'query'. In terms of procs you must replace the proc either by using 'replace' or 'drop' and 'create'. Which one depends on the database. If the query is other code then the code must be updated.
-
for example I have 1 query in who participate 3 columns in 2 table and I want to add 1 column in first table and column in query will be 4. I want do this with code.
ivo75 wrote:
I want to add 1 column in first table and column in query will be 4.
As jschell indicated, you will need to use an alter statement to replace the existing view with a new one. Here is a site that has more detail about how you alter a veiw in Access (I didn't think it was posible, but then I havent worked with MS Access since 1997) http://allenbrowne.com/func-DDL.html[^]
Common sense is admitting there is cause and effect and that you can exert some control over what you understand.
-
for example I have 1 query in who participate 3 columns in 2 table and I want to add 1 column in first table and column in query will be 4. I want do this with code.
ivo75 wrote:
for example I have 1 query in who participate 3 columns in 2 table and I want to add 1 column in first table and column in query will be 4. I want do this with code.
Not sure I understand what you are saying. However you appear to be referring to that you now have the following: select t.a, t.b, t.c from... And you want the following: select t.a, t.b, t.c, t.d from... The problem with that is that SOMETHING is using the first query. And it is not going to magically use the second one. At best (depending on a number of things) it will simply do nothing at all. At worse something will fail in a way that makes it difficult to determine what happened. So the best case has no impact - so no point in trying to change it. In the worst case many things fail - so not point in trying to change it. Thus it follows, what you think that you want to do will NOT work.
-
Hi I use this
ALTER TABLE table_name
ADD column_name datatypeto add column in table. How to use Alter Query to add column in query? I use MS Access 2003.
alter exists column datatype. alter table tblname alter column columnname datatype(variablesize) or add new column................
alter table tblname
add columnname datatype(variablesize)