SQL SELECT INTO Statement
The SELECT INTO Statement
The SELECT INTO statement is most often used to create backup copies of tables or
for archiving records.
Syntax
SELECT column_name(s) INTO newtable [IN externaldatabase]
FROM source
|
Make a Backup Copy
The following example makes a backup copy of the "Persons" table:
SELECT * INTO Persons_backup
FROM Persons
|
The IN clause can be used to copy tables into another database:
SELECT Persons.* INTO Persons IN 'Backup.mdb'
FROM Persons
|
If you only want to copy a few fields, you can do so by listing them after
the SELECT statement:
SELECT LastName,FirstName INTO Persons_backup
FROM Persons
|
You can also add a WHERE clause. The following example
creates a "Persons_backup" table with two columns (FirstName and
LastName) by extracting the persons who
lives in "Sandnes" from the "Persons"
table:
SELECT LastName,Firstname INTO Persons_backup
FROM Persons
WHERE City='Sandnes'
|
Selecting data from more than one table is also possible. The following example creates
a new table "Empl_Ord_backup" that contains data from the two tables Employees and
Orders:
SELECT Employees.Name,Orders.Product
INTO Empl_Ord_backup
FROM Employees
INNER JOIN Orders
ON Employees.Employee_ID=Orders.Employee_ID
|
 |
 |
 |
 |
|
The Ektron Intranet
lets you do everything you need to do on your corporate intranet and everything you want to do... all with just one application.
What can you do with the Ektron Intranet? |
 |
Navigate through content, documents, assets, colleagues and workgroups quickly and intuitively with enterprise search |
 |
Communicate with friends and colleagues with forums, message boards and corporate blogging using the new Social Networking Platform |

|
Utilize the extensive out-of-the box features or customize your site through Ektron CMS400.NET's open architecture |
 |
Promote collaboration in your organization through project workspaces where others can efficiently find information and work together |
 |
Author/edit content, manage navigation, menus, audit trails, workflow and approvals with the best in breed Content Management |
|
|
|
|
See why there are 20,000+ Ektron integrations worldwide.
|
|
 |
TAKE THE VIDEO TOUR |
 |
or download a FREE TRIAL today. |
|