Sybase 資料一覧

既に存在するテーブルに同一構造の別テーブルのデータを挿入する

2007/12/8更新

対応バージョン: 11.9.2

まだ存在しないテーブルに対してはselect intoを使用すればよいが、既存のテーブルにselect intoを実行すると以下のようなエラーになる。

1> select * into test_new from test_org
2> go
Msg 2714, Level 16, State 1:
Line 1:
There is already an object named 'test_new' in the database.

そこで、以下のようにして既存のテーブルにデータを挿入する。

1> insert into test_new select * from test_org
2> go