テーブルに約 300 列を作成する必要がありますが、手動で作成したくありません。
これどうやってするの?次のような列が必要です
Bigint1..to..Bigint60
Text1 ..to..Text60
等々。
IF (NOT EXISTS (SELECT *
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA = 'dbo'
AND TABLE_NAME = 'mytbl'))
begin
create table OBJ_AttributeValues(
ObjectID numeric(18,0) not null
);
end
else
begin
DECLARE @A INT
set @A = 1;
WHILE(@A <=60)
BEGIN
alter table OBJ_AttributeValues
add ...............................
set @A = @A+1;
END
end
「…」の代わりに何を書けばいいですか?