------------------------------------------------------------
--  blancoDb Enterprise Edition
--  Microsoft SQL Server 2000用 テスト表
------------------------------------------------------------

--------------------------------------
-- 基本的なテスト表
--------------------------------------
CREATE TABLE TestBlancoDbTable1 (
	ColIntNotNull           INT           NOT NULL,
	ColIntNull              INT               NULL,
    ColShortNotNull         SMALLINT      NOT NULL,
    ColShortNull            SMALLINT          NULL,
	ColBigIntNotNull        BIGINT        NOT NULL,
	ColBigIntNull           BIGINT            NULL,
    ColRealNotNull          REAL          NOT NULL,
    ColRealNull             REAL              NULL,
    ColFloatNotNull         FLOAT         NOT NULL,
    ColFloatNull            FLOAT             NULL,
    ColNumeric20NotNull     NUMERIC(20)   NOT NULL,
    ColNumeric20Null        NUMERIC(20)       NULL,
    ColDecimal15NotNull     DECIMAL(15)   NOT NULL,
    ColDecimal15Null        DECIMAL(15)       NULL,
    ColDecimal153NotNull    DECIMAL(15,3) NOT NULL,
    ColDecimal153Null       DECIMAL(15,3)     NULL,
    ColBitNotNull           BIT           NOT NULL,
    ColBitNull              BIT               NULL,
    ColBinary100NotNull     BINARY(100)   NOT NULL,
    ColBinary100Null        BINARY(100)       NULL,
    ColImageNotNull         IMAGE         NOT NULL,
    ColImageNull            IMAGE             NULL,
    ColChar1NotNull         CHAR(1)       NOT NULL,
    ColChar1Null            CHAR(1)           NULL,
    ColChar2NotNull         CHAR(2)       NOT NULL,
    ColChar2Null            CHAR(2)           NULL,
    ColChar10NotNull        CHAR(10)      NOT NULL,
    ColChar10Null           CHAR(10)          NULL,
    ColNChar10NotNull       NCHAR(10)     NOT NULL,
    ColNChar10Null          NCHAR(10)         NULL,
    ColVarchar10NotNull     VARCHAR(10)   NOT NULL,
    ColVarchar10Null        VARCHAR(10)       NULL,
    ColVarchar255NotNull    VARCHAR(255)  NOT NULL,
    ColVarchar255Null       VARCHAR(255)      NULL,
    ColVarchar1000Null      VARCHAR(1000)     NULL,
    ColNVarchar255NotNull   NVARCHAR(255) NOT NULL,
    ColNVarchar255Null      NVARCHAR(255)     NULL,
    ColNtext                NTEXT             NULL,
    --ColDateNotNull          DATE        NOT NULL,
    --ColTimeNotNull          TIME        NOT NULL,
    ColDatetimeNotNull      DATETIME      NOT NULL,
    ColDatetimeNull         DATETIME          NULL,
	PRIMARY KEY (ColIntNotNull)
);

--------------------------------------
-- 基本的なテスト用仮想表
--------------------------------------
CREATE VIEW TestBlancoDbViewTable1 AS
  SELECT ColShortNotNull, ColVarchar10Null, ColIntNotNull
  FROM TestBlancoDbTable1

--------------------------------------
-- TINYINT試験用
--------------------------------------
CREATE TABLE TestBlancoDbTable2 (
	ColIntNotNull           INT           NOT NULL,
	ColIntNull              INT               NULL,
    ColTinyIntNotNull       TINYINT       NOT NULL,
    ColTinyIntNull          TINYINT           NULL,
    ColShortNotNull         SMALLINT      NOT NULL,
    ColShortNull            SMALLINT          NULL,
	ColBigIntNotNull        BIGINT        NOT NULL,
	ColBigIntNull           BIGINT            NULL,
	PRIMARY KEY (ColIntNotNull)
);

--------------------------------------
-- アンダースコアを２つ含んだ表の試験用
-- 0.9.5では動作しません。
--------------------------------------
CREATE TABLE TestBlancoDbTable3 (
	a_b          INT           NOT NULL,
	b__c         INT               NULL,
    c___d        TINYINT       NOT NULL,
    d____e       TINYINT           NULL,
    _e_f         SMALLINT      NOT NULL,
    g            SMALLINT          NULL,
	h_           BIGINT        NOT NULL,
	PRIMARY KEY (a_b)
);

--------------------------------------
-- 日本語名を含んだ表の試験用
-- AliasPool.xmlを利用して動作します。
--------------------------------------
CREATE TABLE テストブランコＤｂ表4 (
    列名１          INT           NOT NULL,
    列名２          INT               NULL,
    日本語名        TINYINT       NOT NULL,
	PRIMARY KEY (列名１)
);


CREATE TABLE TestBlancoDbTable1a (
	ColIntNotNull           INT           NOT NULL,
	ColIntNull              INT               NULL,
    ColShortNotNull         SMALLINT      NOT NULL,
    ColShortNull            SMALLINT          NULL,
	ColBigIntNotNull        BIGINT        NOT NULL,
	ColBigIntNull           BIGINT            NULL,
    ColRealNotNull          REAL          NOT NULL,
    ColRealNull             REAL              NULL,
    ColFloatNotNull         FLOAT         NOT NULL,
    ColFloatNull            FLOAT             NULL,
    ColNumeric20NotNull     NUMERIC(20)   NOT NULL,
    ColNumeric20Null        NUMERIC(20)       NULL,
    ColDecimal15NotNull     DECIMAL(15)   NOT NULL,
    ColDecimal15Null        DECIMAL(15)       NULL,
    ColDecimal153NotNull    DECIMAL(15,3) NOT NULL,
    ColDecimal153Null       DECIMAL(15,3)     NULL,
    ColBitNotNull           BIT           NOT NULL,
    ColBitNull              BIT               NULL,
    ColBinary100NotNull     BINARY(100)   NOT NULL,
    ColBinary100Null        BINARY(100)       NULL,
    ColImageNotNull         IMAGE         NOT NULL,
    ColImageNull            IMAGE             NULL,
    ColChar1NotNull         CHAR(1)       NOT NULL,
    ColChar1Null            CHAR(1)           NULL,
    ColChar2NotNull         CHAR(2)       NOT NULL,
    ColChar2Null            CHAR(2)           NULL,
    ColChar10NotNull        CHAR(10)      NOT NULL,
    ColChar10Null           CHAR(10)          NULL,
    ColNChar10NotNull       NCHAR(10)     NOT NULL,
    ColNChar10Null          NCHAR(10)         NULL,
    ColVarchar10NotNull     VARCHAR(10)   NOT NULL,
    ColVarchar10Null        VARCHAR(10)       NULL,
    ColVarchar255NotNull    VARCHAR(255)  NOT NULL,
    ColVarchar255Null       VARCHAR(255)      NULL,
    ColVarchar1000Null      VARCHAR(1000)     NULL,
    ColNVarchar255NotNull   NVARCHAR(255) NOT NULL,
    ColNVarchar255Null      NVARCHAR(255)     NULL,
    --ColDateNotNull          DATE        NOT NULL,
    --ColDateNull             DATE            NULL,
    --ColTimeNotNull          TIME        NOT NULL,
    --ColTimeNull             TIME            NULL,
    ColDatetimeNotNull      DATETIME      NOT NULL,
    ColDatetimeNull         DATETIME          NULL,
	PRIMARY KEY (ColIntNotNull, ColShortNotNull, ColBigIntNotNull, ColRealNotNull, ColFloatNotNull,
	    ColNumeric20NotNull, ColDecimal15NotNull, ColDecimal153NotNull,
	    ColBitNotNull, ColBinary100NotNull, ColChar1NotNull, ColChar10NotNull,
	    ColVarchar255NotNull, ColDatetimeNotNull)
);


