PHP Code:
Declare @ColumnAmount tinyint = 64
Declare
@CurColumn tinyint = 1,
@CreateTable varchar(max) = 'CREATE TABLE _ChardataBulk ( ';
WHILE (@CurColumn <= @ColumnAmount)
BEGIN
SET @CreateTable += ' Column'+CONVERT(varchar(2),@CurColumn)+' varchar(max) NULL, '
SET @CurColumn += 1
END
SET @CreateTable = LEFT(@CreateTable,LEN(@CreateTable)-1) + ')'
EXEC (@CreateTable)
SELECT * FROM _ChardataBulk
DROP TABLE _ChardataBulk
--> Table with 64 Columns
EDIT:
Actually you could also recreate _RefObjCommon+_RefObjChar w/o the columns which the chardata doesn't contain..
Right Click on the Table -> Script Table as -> Create To -> New Query Editor Window
(for _RefObjCommon as well as _RefObjItem, naturally to one table with a different name, to have the right column datatypes)
(SQL '08)