By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,248 Members | 1,961 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,248 IT Pros & Developers. It's quick & easy.

Copy table to new one with primary key

P: 3
this isi my first question here and I hpe I find the solution, that I need the SQL code of copy table to new one woth primary key, for example I have table of barcode, quantity, descryption,.... without primary key to new table making Barcode as primary key (there is no duplicated barcode in the first table), and I want to add new field to the new table, all in one MS access quiry.
Thanks in advace
Jan 12 '08 #1
Share this Question
Share on Google+
3 Replies


ADezii
Expert 5K+
P: 8,624
this isi my first question here and I hpe I find the solution, that I need the SQL code of copy table to new one woth primary key, for example I have table of barcode, quantity, descryption,.... without primary key to new table making Barcode as primary key (there is no duplicated barcode in the first table), and I want to add new field to the new table, all in one MS access quiry.
Thanks in advace
You would like to:
  1. Make a copy of an existing Table.
  2. Create a Primary Key on one of the Fields.
  3. Add a New Field to the newly copied Table.
All in one operation? I do not think that is possible.
Jan 12 '08 #2

P: 3
Yes I need write SQL in one query in MS access
1- Copy table to new one
2- Create Primary key in field Barcode (there is no duplicated in barcode in the copied table)
3- creat new file in the copied file

Thanks
Jan 14 '08 #3

P: 3
let me talk about my Access project I do for the my company
1- after stoketake, we need so program to delete duplicated scan code and sum the quantities of each deleted duplicated item
2- then compare the scanned filtered file with the main file exported from the company system witch contains all the exist items in the company, so result compared file must have the scaned items (no duplucted barcodes because we filtered them in the first step and calculated the quantites of same scanned barcodes) and must contain the scaned quantity, main quantity in the main system file and diff. between them (missed items)
so I wanted to copy the scanned table file, add two fields for main quantity and diff in quantity
I need the SQL code to copy table, add primary key, add two fileds

I did it by writing eack SQL statement in on string variable in VB code
if you like to get look and advice for any changes in the program I may link it in the forum.
Jan 14 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.