473,748 Members | 5,849 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Copying all columns from another table

I am trying to "Copy all columns from another table" here is the SQL
code I am using in MS Access:

CREATE TABLE suppliers
AS (SELECT *
FROM companies
WHERE id 1000);

I think I got it to work once using INTO instead of FROM.

Can you assist me?

Thanks in advance!

John

Mar 13 '07 #1
1 1838
On Mar 13, 4:37 pm, "jmarr02s" <john.marru...@ illinois.govwro te:
I am trying to "Copy all columns from another table" here is the SQL
code I am using in MS Access:

CREATE TABLE suppliers
AS (SELECT *
FROM companies
WHERE id 1000);

I think I got it to work once using INTO instead of FROM.

Can you assist me?

Thanks in advance!

John

Have you tried using the query designer? Even when I don't save the
query I use it to construct the sql for use elsewhere.

Mar 13 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
32352
by: Caroline | last post by:
I need to update a table by copying a column from another table (having the same structure, but on another database), from the record having the same primary key. 1 - What is the correct query? 2 - I tried copying them record by record, but the datatype is ntext, (it displays <long
3
13276
by: Rebecca Lovelace | last post by:
For some reason in Enterprise Manager for SQL Server 2000, I cannot put the following line into a trigger: select * into #deleted from deleted When I hit the Apply button I get the following error: Cannot use text, ntext, or image columns in the 'inserted' or 'deleted' tables This seems like a weird error, since I am not actually doing anything to the inserted or deleted tables, I am just trying to make a temp copy.
4
18696
by: Gordon Burditt | last post by:
What's the easiest way to copy a row from one table to another (with the same schema), without knowing in advance the number and types of the columns? The problem: I have several sets of tables with a primary key of 'account', which contains an email address. If someone changes their email address, I need to change the 'account' field. Unfortunately, someone thought it would speed up lookups if instead of having one table 'settings',...
1
1732
by: usaims | last post by:
I'm learning how to copy columns and I'm having a little trouble. The column that I'm trying to copy is from the same database. Correct me if I am wrong, but I think you have to create the column in the database first? Here is the command that I'm using, but its not working, obviously. mysql> alter table bugs add column test mediumint(9) NOT NULL auto_increment; ERROR 1075 (42000): Incorrect table definition; there can be only one auto...
2
3265
by: Stefan Schneider | last post by:
Hi, I have to copy an existing database from one Windows-Server to another one. The source database is a 8.1.0 database on a Windows 2000 Server, the destination database will be a newer 8.x database on a Windows 2003 Server. What is the preferred way to copy the old data to the new server? Should I use the backup/restore tools or is there a better way like copying the tablespace files?
5
2465
by: Nathan Sokalski | last post by:
I am writing an ASP.NET application in which I need to copy DataRows from one DataTable to another. When I use code such as the following: temprows = nodes.Select("state='PA'") temptable.Clear() For Each row As DataRow In temprows temptable.Rows.Add(row) Next
2
1438
by: Rick Palmer | last post by:
OK, I got something REALLY simple-sounding that is turning in to something REALLY frickin hard. All I need to do is suck the data out of one Access database and stuff it in another one. Here's my current code: Sub main() 'First download the database from the web server Dim ftp As New FTPFunctions.FTPClassClass ftp.FTPDownload("remotename.mdb", "localname.mdb", "www.someserver.com", "username", "passwordtext")
1
5095
by: eric | last post by:
Hi, Can anyone please explain to me how I can cop selected items from a multi listbox(simple) to another multi listbox? the code I found on msdn only seems to support single column copies, i need to copy 3 colums per selection I was using a for each itm in somelist.itemsselected
1
6749
by: tshad | last post by:
Running on VS.net 2005, I am trying to copy rows from my datatable to another datatable in the same dataset. The schema would be identical. I need to make the table name "forms" as I am passing this dataset to function that expects a dataset with a datatable in it.
0
9530
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9312
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9238
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8237
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6793
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4593
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4864
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2775
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2206
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.