1. ホーム
  2. sql-server-2005

[解決済み] テーブルを変更し、複数の列を追加する ms sql

2022-04-27 13:17:49

質問

次のクエリのどこに間違いがあるか、どなたか教えてください。

ALTER TABLE Countries
ADD ( 
HasPhotoInReadyStorage  bit,
 HasPhotoInWorkStorage  bit,
 HasPhotoInMaterialStorage bit,
 HasText  bit);

ALTER TABLE Regions
ADD ( HasPhotoInReadyStorage  bit,
 HasPhotoInWorkStorage  bit,
 HasPhotoInMaterialStorage bit
 HasText  bit);

ALTER TABLE Provinces
ADD ( HasPhotoInReadyStorage  bit,
 HasPhotoInWorkStorage  bit,
 HasPhotoInMaterialStorage bit
 HasText  bit);


ALTER TABLE Cities
ADD ( HasPhotoInReadyStorage  bit,
 HasPhotoInWorkStorage  bit,
 HasPhotoInMaterialStorage bit
 HasText  bit);

Alter table Hotels
Add 
{
 HasPhotoInReadyStorage  bit,
 HasPhotoInWorkStorage  bit,
 HasPhotoInMaterialStorage bit,
 HasHotelPhotoInReadyStorage  bit,
 HasHotelPhotoInWorkStorage  bit,
 HasHotelPhotoInMaterialStorage bit,
 HasReporterData  bit,
 HasMovieInReadyStorage  bit,
 HasMovieInWorkStorage  bit,
 HasMovieInMaterialStorage bit
};

以下のようなエラーが発生します。

Msg 102, Level 15, State 1, Line 2
Incorrect syntax near '('.
Msg 102, Level 15, State 1, Line 9
Incorrect syntax near '('.
Msg 102, Level 15, State 1, Line 15
Incorrect syntax near '('.
Msg 102, Level 15, State 1, Line 22
Incorrect syntax near '('.
Msg 102, Level 15, State 1, Line 29
Incorrect syntax near '{'.

解決方法は?

括弧と中括弧は、カラムを追加する際には必要ありません。