Как лучше перенести данные из одной таблицы в другую (такую же) ?

Kesha
Дата: 18.12.2002 12:46:24
Как лучше перенести данные из одной таблицы в другую (такую же) ?
Lexis
Дата: 18.12.2002 12:47:53

The SELECT INTO statement creates a new table and populates it with the result
set of the SELECT. The structure of the new table is defined by the attributes of
the expressions in the select list, for example:


SELECT Shippers.*, Link.Address, Link.City,
Link.Region, Link.PostalCode
INTO NewShippers
FROM Shippers
JOIN LinkServer.DB.dbo.Shippers AS Link
ON (Shippers.ShipperID = Link.ShipperID)

SELECT INTO can be used to combine data from several tables or views into one
table. It can also be used to create a new table containing data selected from a
linked server.

Kesha
Дата: 18.12.2002 12:59:17
У меня например есть таблица Subscriber и я пытаюсь перевести из неё данные в таблицу SubscriberTemp ,когда AccountID из Subscriber =1 ? С примером у меня ничего не вышло .
Kesha
Дата: 18.12.2002 13:01:12
Таблица SubscriberTemp у меня уже существует
Lexis
Дата: 18.12.2002 13:05:52

INSERT INTO MyBooks
SELECT title_id, title, type
FROM titles
WHERE type = 'mod_cook'

Kesha
Дата: 18.12.2002 13:08:59
А есть такое дело как Remove или мне как-то надо вручную стирать ?
Белов Владимир
Дата: 18.12.2002 13:09:04
1. обычным DTS-пакетом.
2. insert into ... select ...
Lexis
Дата: 18.12.2002 13:10:02
truncate table Жители_Нашего_Городка
delete from Жители_Нашего_Городка
Kesha
Дата: 18.12.2002 13:28:33
Spasibo bolshoe za otveti !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!