CREATE DATABASE "output.add" ENCRYPT False
EXECUTE PROCEDURE
   sp_ModifyDatabase
      (
        'Version_Major',
        '0'
      );

EXECUTE PROCEDURE
   sp_ModifyDatabase
      (
        'Version_Minor',
        '0'
      );

EXECUTE PROCEDURE
   sp_ModifyDatabase
      (
        'Default_Table_Path',
        '.\'
      );

EXECUTE PROCEDURE
   sp_ModifyDatabase
      (
        'Temp_Table_Path',
        '.\'
      );

EXECUTE PROCEDURE
   sp_ModifyDatabase
      (
        'Log_In_Required',
        'False'
      );

EXECUTE PROCEDURE
   sp_ModifyDatabase
      (
        'Verify_Access_Rights',
        'False'
      );

EXECUTE PROCEDURE
   sp_ModifyDatabase
      (
        'Encrypt_Table_Password',
        ''
      );

EXECUTE PROCEDURE
   sp_ModifyDatabase
      (
        'Encrypt_New_Table',
        'False'
      );

EXECUTE PROCEDURE
   sp_ModifyDatabase
      (
        'Enable_Internet',
        'False'
      );

EXECUTE PROCEDURE
   sp_ModifyDatabase
      (
        'Internet_Security_Level',
        '2'
      );

EXECUTE PROCEDURE
   sp_ModifyDatabase
      (
        'Max_Failed_Attempts',
        '5'
      );

EXECUTE PROCEDURE
   sp_ModifyDatabase
      (
        'Logins_Disabled',
        'False'
      );

EXECUTE PROCEDURE
   sp_ModifyDatabase
      (
        'Logins_Disabled_Msg',
        ''
      );

EXECUTE PROCEDURE
   sp_ModifyDatabase
      (
        'Comment',
        ''
      );

EXECUTE PROCEDURE
   sp_ModifyDatabase
      (
        'User_Defined_Prop',
        ''
      );

EXECUTE PROCEDURE
   sp_ModifyDatabase
      (
        'FTS_Delimiters',
        
      );

EXECUTE PROCEDURE
   sp_ModifyDatabase
      (
        'FTS_Noise_Words',
        ''
      );

EXECUTE PROCEDURE
   sp_ModifyDatabase
      (
        'FTS_Drop_Chars',
        ''
      );

EXECUTE PROCEDURE
   sp_ModifyDatabase
      (
        'FTS_Conditional_Chars',
        ''
      );

EXECUTE PROCEDURE
   sp_ModifyDatabase
      (
        'Encrypt_Indexes',
        'False'
      );

EXECUTE PROCEDURE
   sp_ModifyDatabase
      (
        'Query_Log_Table',
        ''
      );

EXECUTE PROCEDURE
   sp_ModifyDatabase
      (
        'Encrypt_Communication',
        'False'
      );

EXECUTE PROCEDURE
   sp_ModifyDatabase
      (
        'Disable_DLL_Caching',
        'False'
      );

EXECUTE PROCEDURE
   sp_ModifyDatabase
      (
        'Triggers_Disabled',
        'False'
      );

CREATE TABLE MysteryTriples ( 
      UID Integer,
      UTCTimestamp TimeStamp,
      Tag CIChar( 1 ),
      BoardSlot Integer,
      WM Integer,
      Value Double( 0 ),
      Sensor_xxx CIChar( 50 )) IN DATABASE;
EXECUTE PROCEDURE sp_ModifyTableProperty( 'MysteryTriples', 
   'Table_Auto_Create', 
   'False', 'APPEND_FAIL', 'MysteryTriplesfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'MysteryTriples', 
   'Table_Permission_Level', 
   '2', 'APPEND_FAIL', 'MysteryTriplesfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'MysteryTriples', 
   'Triggers_Disabled', 
   'False', 'APPEND_FAIL', 'MysteryTriplesfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'MysteryTriples', 
   'Table_Trans_Free', 
   'False', 'APPEND_FAIL', 'MysteryTriplesfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'MysteryTriples', 
   'Table_WEB_delta', 
   'False', 'APPEND_FAIL', 'MysteryTriplesfail');

CREATE TABLE Rain ( 
      Rainmm Double( 0 ),
      UID Integer,
      WhenRecorded TimeStamp,
      WhenRecordedUTC TimeStamp,
      EventCount Integer) IN DATABASE;
EXECUTE PROCEDURE sp_CreateIndex90( 
   'Rain',
   'Rain.adi',
   'BYUID',
   'UID',
   '',
   2,
   512,
   '' ); 


EXECUTE PROCEDURE sp_CreateIndex90( 
   'Rain',
   'Rain.adi',
   'BYWHEN',
   'WhenRecordedUTC; UID',
   '',
   2,
   512,
   '' ); 


EXECUTE PROCEDURE sp_ModifyTableProperty( 'Rain', 
   'Table_Auto_Create', 
   'False', 'APPEND_FAIL', 'Rainfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Rain', 
   'Table_Permission_Level', 
   '2', 'APPEND_FAIL', 'Rainfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Rain', 
   'Triggers_Disabled', 
   'False', 'APPEND_FAIL', 'Rainfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Rain', 
   'Table_Trans_Free', 
   'False', 'APPEND_FAIL', 'Rainfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Rain', 
   'Table_WEB_delta', 
   'False', 'APPEND_FAIL', 'Rainfail');

CREATE TABLE [.\old data\Rain_old.adt] ( 
      Rainmm Double( 0 ),
      UID Integer,
      WhenRecorded TimeStamp,
      WhenRecordedUTC TimeStamp) IN DATABASE;
EXECUTE PROCEDURE sp_CreateIndex90( 
   'Rain_old',
   'Rain_old.adi',
   'BYUID',
   'UID',
   '',
   2,
   512,
   '' ); 


EXECUTE PROCEDURE sp_CreateIndex90( 
   'Rain_old',
   'Rain_old.adi',
   'BYWHEN',
   'WhenRecordedUTC;UID',
   '',
   2,
   512,
   '' ); 


EXECUTE PROCEDURE sp_ModifyTableProperty( 'Rain_old', 
   'Table_Auto_Create', 
   'False', 'APPEND_FAIL', 'Rain_oldfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Rain_old', 
   'Table_Permission_Level', 
   '2', 'APPEND_FAIL', 'Rain_oldfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Rain_old', 
   'Triggers_Disabled', 
   'False', 'APPEND_FAIL', 'Rain_oldfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Rain_old', 
   'Table_Trans_Free', 
   'False', 'APPEND_FAIL', 'Rain_oldfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Rain_old', 
   'Table_WEB_delta', 
   'False', 'APPEND_FAIL', 'Rain_oldfail');

CREATE TABLE TRHP ( 
      DewPointF Double( 0 ),
      ObservedUID Integer,
      RH Double( 0 ),
      TempF Double( 0 ),
      UID Integer,
      WhenRecorded TimeStamp,
      WhenRecordedUTC TimeStamp,
      PressureInches Double( 0 ),
      HumidexF Double( 0 )) IN DATABASE;
EXECUTE PROCEDURE sp_CreateIndex90( 
   'TRHP',
   'TRHP.adi',
   'BYUID',
   'UID',
   '',
   2,
   512,
   '' ); 


EXECUTE PROCEDURE sp_CreateIndex90( 
   'TRHP',
   'TRHP.adi',
   'BYUTC',
   'WhenRecordedUTC;UID',
   '',
   2,
   512,
   '' ); 


EXECUTE PROCEDURE sp_CreateIndex90( 
   'TRHP',
   'TRHP.adi',
   'BYOBSERVED',
   'ObservedUID;WhenRecordedUTC;UID',
   '',
   2,
   512,
   '' ); 


EXECUTE PROCEDURE sp_ModifyTableProperty( 'TRHP', 
   'Table_Auto_Create', 
   'False', 'APPEND_FAIL', 'TRHPfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'TRHP', 
   'Table_Permission_Level', 
   '2', 'APPEND_FAIL', 'TRHPfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'TRHP', 
   'Triggers_Disabled', 
   'False', 'APPEND_FAIL', 'TRHPfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'TRHP', 
   'Table_Trans_Free', 
   'False', 'APPEND_FAIL', 'TRHPfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'TRHP', 
   'Table_WEB_delta', 
   'False', 'APPEND_FAIL', 'TRHPfail');

CREATE TABLE CO2 ( 
      UID Integer,
      WhenRecorded TimeStamp,
      WhenRecordedUTC TimeStamp,
      ObservedUID Integer,
      CO2ppm Integer) IN DATABASE;
EXECUTE PROCEDURE sp_CreateIndex90( 
   'CO2',
   'CO2.adi',
   'BYWHEN',
   'WhenRecordedUTC',
   '',
   2,
   512,
   '' ); 


EXECUTE PROCEDURE sp_ModifyTableProperty( 'CO2', 
   'Table_Auto_Create', 
   'False', 'APPEND_FAIL', 'CO2fail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'CO2', 
   'Table_Permission_Level', 
   '2', 'APPEND_FAIL', 'CO2fail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'CO2', 
   'Table_Memo_Block_Size', 
   '8', 'APPEND_FAIL', 'CO2fail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'CO2', 
   'Triggers_Disabled', 
   'False', 'APPEND_FAIL', 'CO2fail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'CO2', 
   'Table_Trans_Free', 
   'False', 'APPEND_FAIL', 'CO2fail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'CO2', 
   'Table_WEB_delta', 
   'False', 'APPEND_FAIL', 'CO2fail');

CREATE TABLE [.\old data\OnOff_old.adt] ( 
      OnOnOn Logical,
      ObservedUID Integer,
      HoursOn Double( 0 ),
      UID Integer,
      WhenRecorded TimeStamp,
      WhenRecordedUTC TimeStamp) IN DATABASE;
EXECUTE PROCEDURE sp_CreateIndex90( 
   'OnOff_old',
   'OnOff_old.adi',
   'BYUID',
   'UID',
   '',
   2,
   512,
   '' ); 


EXECUTE PROCEDURE sp_CreateIndex90( 
   'OnOff_old',
   'OnOff_old.adi',
   'BYWHEN',
   'WhenRecordedUTC;UID',
   '',
   2,
   512,
   '' ); 


EXECUTE PROCEDURE sp_CreateIndex90( 
   'OnOff_old',
   'OnOff_old.adi',
   'BYOBSERVED',
   'ObservedUID;WhenRecordedUTC;UID',
   '',
   2,
   512,
   '' ); 


EXECUTE PROCEDURE sp_ModifyTableProperty( 'OnOff_old', 
   'Table_Auto_Create', 
   'False', 'APPEND_FAIL', 'OnOff_oldfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'OnOff_old', 
   'Table_Permission_Level', 
   '2', 'APPEND_FAIL', 'OnOff_oldfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'OnOff_old', 
   'Triggers_Disabled', 
   'False', 'APPEND_FAIL', 'OnOff_oldfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'OnOff_old', 
   'Table_Trans_Free', 
   'False', 'APPEND_FAIL', 'OnOff_oldfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'OnOff_old', 
   'Table_WEB_delta', 
   'False', 'APPEND_FAIL', 'OnOff_oldfail');

CREATE TABLE Wind ( 
      Direction Double( 0 ),
      UID Integer,
      WhenRecorded TimeStamp,
      WhenRecordedUTC TimeStamp,
      WindMPH Double( 0 ),
      WindMPHMax Double( 0 ),
      WindMPHMin Double( 0 ),
      WindMPHRaw Double( 0 )) IN DATABASE;
EXECUTE PROCEDURE sp_CreateIndex90( 
   'Wind',
   'Wind.adi',
   'BYUID',
   'UID',
   '',
   2,
   512,
   '' ); 


EXECUTE PROCEDURE sp_CreateIndex90( 
   'Wind',
   'Wind.adi',
   'BYWHEN',
   'WhenRecordedUTC;UID',
   '',
   2,
   512,
   '' ); 


EXECUTE PROCEDURE sp_ModifyTableProperty( 'Wind', 
   'Table_Auto_Create', 
   'False', 'APPEND_FAIL', 'Windfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Wind', 
   'Table_Permission_Level', 
   '2', 'APPEND_FAIL', 'Windfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Wind', 
   'Triggers_Disabled', 
   'False', 'APPEND_FAIL', 'Windfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Wind', 
   'Table_Trans_Free', 
   'False', 'APPEND_FAIL', 'Windfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Wind', 
   'Table_WEB_delta', 
   'False', 'APPEND_FAIL', 'Windfail');

CREATE TABLE [.\old data\Lightning_old.adt] ( 
      UID Integer,
      WhenRecorded TimeStamp,
      WhenRecordedUTC TimeStamp,
      NFlashes Integer,
      KmToStorm Integer,
      StormEnergy Double( 0 ),
      DistPerHour Double( 0 ),
      NoisePerHour Double( 0 )) IN DATABASE;
EXECUTE PROCEDURE sp_CreateIndex90( 
   'Lightning_old',
   'Lightning_old.adi',
   'BYUID',
   'UID',
   '',
   2,
   512,
   '' ); 


EXECUTE PROCEDURE sp_CreateIndex90( 
   'Lightning_old',
   'Lightning_old.adi',
   'BYWHEN',
   'WhenRecordedUTC',
   '',
   2,
   512,
   '' ); 


EXECUTE PROCEDURE sp_ModifyTableProperty( 'Lightning_old', 
   'Table_Auto_Create', 
   'False', 'APPEND_FAIL', 'Lightning_oldfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Lightning_old', 
   'Table_Permission_Level', 
   '2', 'APPEND_FAIL', 'Lightning_oldfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Lightning_old', 
   'Triggers_Disabled', 
   'False', 'APPEND_FAIL', 'Lightning_oldfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Lightning_old', 
   'Table_Trans_Free', 
   'False', 'APPEND_FAIL', 'Lightning_oldfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Lightning_old', 
   'Table_WEB_delta', 
   'False', 'APPEND_FAIL', 'Lightning_oldfail');

CREATE TABLE [.\old data\Light_old.adt] ( 
      Light Double( 0 ),
      ObservedUID Integer,
      UID Integer,
      WhenRecorded TimeStamp,
      WhenRecordedUTC TimeStamp) IN DATABASE;
EXECUTE PROCEDURE sp_CreateIndex90( 
   'Light_old',
   'Light_old.adi',
   'BYUID',
   'UID',
   '',
   2,
   512,
   '' ); 


EXECUTE PROCEDURE sp_CreateIndex90( 
   'Light_old',
   'Light_old.adi',
   'BYWHEN',
   'WhenRecordedUTC',
   '',
   2,
   512,
   '' ); 


EXECUTE PROCEDURE sp_ModifyTableProperty( 'Light_old', 
   'Table_Auto_Create', 
   'False', 'APPEND_FAIL', 'Light_oldfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Light_old', 
   'Table_Permission_Level', 
   '2', 'APPEND_FAIL', 'Light_oldfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Light_old', 
   'Triggers_Disabled', 
   'False', 'APPEND_FAIL', 'Light_oldfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Light_old', 
   'Table_Trans_Free', 
   'False', 'APPEND_FAIL', 'Light_oldfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Light_old', 
   'Table_WEB_delta', 
   'False', 'APPEND_FAIL', 'Light_oldfail');

CREATE TABLE OnOff ( 
      OnOnOn Logical,
      ObservedUID Integer,
      HoursOn Double( 0 ),
      UID Integer,
      WhenRecorded TimeStamp,
      WhenRecordedUTC TimeStamp) IN DATABASE;
EXECUTE PROCEDURE sp_CreateIndex90( 
   'OnOff',
   'OnOff.adi',
   'BYUID',
   'UID',
   '',
   2,
   512,
   '' ); 


EXECUTE PROCEDURE sp_CreateIndex90( 
   'OnOff',
   'OnOff.adi',
   'BYWHEN',
   'WhenRecordedUTC',
   '',
   2,
   512,
   '' ); 


EXECUTE PROCEDURE sp_CreateIndex90( 
   'OnOff',
   'OnOff.adi',
   'BYOBSERVED',
   'ObservedUID;WhenRecordedUTC;UID',
   '',
   2,
   512,
   '' ); 


EXECUTE PROCEDURE sp_ModifyTableProperty( 'OnOff', 
   'Table_Auto_Create', 
   'False', 'APPEND_FAIL', 'OnOfffail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'OnOff', 
   'Table_Permission_Level', 
   '2', 'APPEND_FAIL', 'OnOfffail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'OnOff', 
   'Table_Memo_Block_Size', 
   '8', 'APPEND_FAIL', 'OnOfffail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'OnOff', 
   'Triggers_Disabled', 
   'False', 'APPEND_FAIL', 'OnOfffail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'OnOff', 
   'Table_Trans_Free', 
   'False', 'APPEND_FAIL', 'OnOfffail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'OnOff', 
   'Table_WEB_delta', 
   'False', 'APPEND_FAIL', 'OnOfffail');

EXECUTE PROCEDURE sp_ModifyFieldProperty ( 'OnOff', 
      'OnOnOn', 'Comment', 
      '''On'' is reserved word', 'APPEND_FAIL', 'OnOfffail' ); 

CREATE TABLE [.\old data\TRHP_old.adt] ( 
      DewPointF Double( 0 ),
      ObservedUID Integer,
      RH Double( 0 ),
      TempF Double( 0 ),
      UID Integer,
      WhenRecorded TimeStamp,
      WhenRecordedUTC TimeStamp,
      PressureInches Double( 0 ),
      HumidexF Double( 0 )) IN DATABASE;
EXECUTE PROCEDURE sp_CreateIndex90( 
   'TRHP_old',
   'TRHP_old.adi',
   'BYUID',
   'UID',
   '',
   2,
   512,
   '' ); 


EXECUTE PROCEDURE sp_CreateIndex90( 
   'TRHP_old',
   'TRHP_old.adi',
   'BYUTC',
   'WhenRecordedUTC;UID',
   '',
   2,
   512,
   '' ); 


EXECUTE PROCEDURE sp_CreateIndex90( 
   'TRHP_old',
   'TRHP_old.adi',
   'BYOBSERVED',
   'ObservedUID;UID',
   '',
   2,
   512,
   '' ); 


EXECUTE PROCEDURE sp_ModifyTableProperty( 'TRHP_old', 
   'Table_Auto_Create', 
   'False', 'APPEND_FAIL', 'TRHP_oldfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'TRHP_old', 
   'Table_Permission_Level', 
   '2', 'APPEND_FAIL', 'TRHP_oldfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'TRHP_old', 
   'Triggers_Disabled', 
   'False', 'APPEND_FAIL', 'TRHP_oldfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'TRHP_old', 
   'Table_Trans_Free', 
   'False', 'APPEND_FAIL', 'TRHP_oldfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'TRHP_old', 
   'Table_WEB_delta', 
   'False', 'APPEND_FAIL', 'TRHP_oldfail');

CREATE TABLE Pond ( 
      DepthInches Double( 0 ),
      WhenRecorded TimeStamp,
      WhenRecordedUTC TimeStamp,
      TempF Double( 0 ),
      UID Integer) IN DATABASE;
EXECUTE PROCEDURE sp_CreateIndex90( 
   'Pond',
   'Pond.adi',
   'BYUID',
   'UID',
   '',
   2,
   512,
   '' ); 


EXECUTE PROCEDURE sp_CreateIndex90( 
   'Pond',
   'Pond.adi',
   'BYWHEN',
   'WhenRecordedUTC',
   '',
   2,
   512,
   '' ); 


EXECUTE PROCEDURE sp_ModifyTableProperty( 'Pond', 
   'Table_Auto_Create', 
   'False', 'APPEND_FAIL', 'Pondfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Pond', 
   'Table_Permission_Level', 
   '2', 'APPEND_FAIL', 'Pondfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Pond', 
   'Table_Memo_Block_Size', 
   '8', 'APPEND_FAIL', 'Pondfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Pond', 
   'Triggers_Disabled', 
   'False', 'APPEND_FAIL', 'Pondfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Pond', 
   'Table_Trans_Free', 
   'False', 'APPEND_FAIL', 'Pondfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Pond', 
   'Table_WEB_delta', 
   'False', 'APPEND_FAIL', 'Pondfail');

CREATE TABLE Light ( 
      Light Double( 0 ),
      ObservedUID Integer,
      UID Integer,
      WhenRecorded TimeStamp,
      WhenRecordedUTC TimeStamp) IN DATABASE;
EXECUTE PROCEDURE sp_CreateIndex90( 
   'Light',
   'Light.adi',
   'BYUID',
   'UID',
   '',
   2,
   512,
   '' ); 


EXECUTE PROCEDURE sp_CreateIndex90( 
   'Light',
   'Light.adi',
   'BYWHEN',
   'WhenRecordedUTC',
   '',
   2,
   512,
   '' ); 


EXECUTE PROCEDURE sp_ModifyTableProperty( 'Light', 
   'Table_Auto_Create', 
   'False', 'APPEND_FAIL', 'Lightfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Light', 
   'Table_Permission_Level', 
   '2', 'APPEND_FAIL', 'Lightfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Light', 
   'Table_Memo_Block_Size', 
   '8', 'APPEND_FAIL', 'Lightfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Light', 
   'Triggers_Disabled', 
   'False', 'APPEND_FAIL', 'Lightfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Light', 
   'Table_Trans_Free', 
   'False', 'APPEND_FAIL', 'Lightfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Light', 
   'Table_WEB_delta', 
   'False', 'APPEND_FAIL', 'Lightfail');

CREATE TABLE Lightning ( 
      UID Integer,
      WhenRecorded TimeStamp,
      WhenRecordedUTC TimeStamp,
      NFlashes Integer,
      KmToStorm Integer,
      StormEnergy Double( 0 ),
      DistPerHour Double( 0 ),
      NoisePerHour Double( 0 )) IN DATABASE;
EXECUTE PROCEDURE sp_CreateIndex90( 
   'Lightning',
   'Lightning.adi',
   'BYUID',
   'UID',
   '',
   2,
   512,
   '' ); 


EXECUTE PROCEDURE sp_CreateIndex90( 
   'Lightning',
   'Lightning.adi',
   'BYWHEN',
   'WhenRecordedUTC',
   '',
   2,
   512,
   '' ); 


EXECUTE PROCEDURE sp_ModifyTableProperty( 'Lightning', 
   'Table_Auto_Create', 
   'False', 'APPEND_FAIL', 'Lightningfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Lightning', 
   'Table_Permission_Level', 
   '2', 'APPEND_FAIL', 'Lightningfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Lightning', 
   'Triggers_Disabled', 
   'False', 'APPEND_FAIL', 'Lightningfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Lightning', 
   'Table_Trans_Free', 
   'False', 'APPEND_FAIL', 'Lightningfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Lightning', 
   'Table_WEB_delta', 
   'False', 'APPEND_FAIL', 'Lightningfail');

CREATE TABLE [.\old data\Wind_old.adt] ( 
      Direction Double( 0 ),
      UID Integer,
      WhenRecorded TimeStamp,
      WhenRecordedUTC TimeStamp,
      WindMPH Double( 0 ),
      WindMPHMax Double( 0 ),
      WindMPHMin Double( 0 ),
      WindMPHRaw Double( 0 )) IN DATABASE;
EXECUTE PROCEDURE sp_CreateIndex90( 
   'Wind_old',
   'Wind_old.adi',
   'BYUID',
   'UID',
   '',
   2,
   512,
   '' ); 


EXECUTE PROCEDURE sp_CreateIndex90( 
   'Wind_old',
   'Wind_old.adi',
   'BYWHEN',
   'WhenRecordedUTC;UID',
   '',
   2,
   512,
   '' ); 


EXECUTE PROCEDURE sp_ModifyTableProperty( 'Wind_old', 
   'Table_Auto_Create', 
   'False', 'APPEND_FAIL', 'Wind_oldfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Wind_old', 
   'Table_Permission_Level', 
   '2', 'APPEND_FAIL', 'Wind_oldfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Wind_old', 
   'Triggers_Disabled', 
   'False', 'APPEND_FAIL', 'Wind_oldfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Wind_old', 
   'Table_Trans_Free', 
   'False', 'APPEND_FAIL', 'Wind_oldfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Wind_old', 
   'Table_WEB_delta', 
   'False', 'APPEND_FAIL', 'Wind_oldfail');

CREATE TABLE SPS30 ( 
      Mass01p0 Double( 0 ),
      Num01p0 Double( 0 ),
      Mass02p5 Double( 0 ),
      Mass04p0 Double( 0 ),
      Mass10p0 Double( 0 ),
      Num00p5 Double( 0 ),
      Num02p5 Double( 0 ),
      Num04p0 Double( 0 ),
      Num10p0 Double( 0 ),
      Typical Double( 0 ),
      UID Integer,
      WhenRecordedUTC TimeStamp,
      WhenRecorded TimeStamp) IN DATABASE;
EXECUTE PROCEDURE sp_CreateIndex90( 
   'SPS30',
   'SPS30.adi',
   'BYUID',
   'UID',
   '',
   2,
   512,
   '' ); 


EXECUTE PROCEDURE sp_CreateIndex90( 
   'SPS30',
   'SPS30.adi',
   'BYWHEN',
   'WhenRecordedUTC',
   '',
   2,
   512,
   '' ); 


EXECUTE PROCEDURE sp_ModifyTableProperty( 'SPS30', 
   'Table_Auto_Create', 
   'False', 'APPEND_FAIL', 'SPS30fail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'SPS30', 
   'Table_Permission_Level', 
   '2', 'APPEND_FAIL', 'SPS30fail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'SPS30', 
   'Triggers_Disabled', 
   'False', 'APPEND_FAIL', 'SPS30fail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'SPS30', 
   'Table_Trans_Free', 
   'False', 'APPEND_FAIL', 'SPS30fail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'SPS30', 
   'Table_WEB_delta', 
   'False', 'APPEND_FAIL', 'SPS30fail');

CREATE TABLE [.\old data\Pond_old.adt] ( 
      DepthInches Double( 0 ),
      WhenRecorded TimeStamp,
      WhenRecordedUTC TimeStamp,
      TempF Double( 0 ),
      UID Integer) IN DATABASE;
EXECUTE PROCEDURE sp_CreateIndex90( 
   'Pond_old',
   'Pond_old.adi',
   'BYUID',
   'UID',
   '',
   2,
   512,
   '' ); 


EXECUTE PROCEDURE sp_CreateIndex90( 
   'Pond_old',
   'Pond_old.adi',
   'BYWHEN',
   'WhenRecordedUTC',
   '',
   2,
   512,
   '' ); 


EXECUTE PROCEDURE sp_ModifyTableProperty( 'Pond_old', 
   'Table_Auto_Create', 
   'False', 'APPEND_FAIL', 'Pond_oldfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Pond_old', 
   'Table_Permission_Level', 
   '2', 'APPEND_FAIL', 'Pond_oldfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Pond_old', 
   'Triggers_Disabled', 
   'False', 'APPEND_FAIL', 'Pond_oldfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Pond_old', 
   'Table_Trans_Free', 
   'False', 'APPEND_FAIL', 'Pond_oldfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Pond_old', 
   'Table_WEB_delta', 
   'False', 'APPEND_FAIL', 'Pond_oldfail');

CREATE TABLE Power ( 
      Amps Double( 0 ),
      UID Integer,
      WhenRecorded TimeStamp,
      WhenRecordedUTC TimeStamp,
      ObservedUID Integer) IN DATABASE;
EXECUTE PROCEDURE sp_CreateIndex90( 
   'Power',
   'Power.adi',
   'BYUID',
   'UID',
   '',
   2,
   512,
   '' ); 


EXECUTE PROCEDURE sp_CreateIndex90( 
   'Power',
   'Power.adi',
   'BYWHEN',
   'WhenRecordedUTC',
   '',
   2,
   512,
   '' ); 


EXECUTE PROCEDURE sp_ModifyTableProperty( 'Power', 
   'Table_Auto_Create', 
   'False', 'APPEND_FAIL', 'Powerfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Power', 
   'Table_Permission_Level', 
   '2', 'APPEND_FAIL', 'Powerfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Power', 
   'Table_Memo_Block_Size', 
   '8', 'APPEND_FAIL', 'Powerfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Power', 
   'Triggers_Disabled', 
   'False', 'APPEND_FAIL', 'Powerfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Power', 
   'Table_Trans_Free', 
   'False', 'APPEND_FAIL', 'Powerfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Power', 
   'Table_WEB_delta', 
   'False', 'APPEND_FAIL', 'Powerfail');

CREATE TABLE [.\old data\SPS30_old.adt] ( 
      Mass01p0 Double( 0 ),
      Num01p0 Double( 0 ),
      Mass02p5 Double( 0 ),
      Mass04p0 Double( 0 ),
      Mass10p0 Double( 0 ),
      Num00p5 Double( 0 ),
      Num02p5 Double( 0 ),
      Num04p0 Double( 0 ),
      Num10p0 Double( 0 ),
      Typical Double( 0 ),
      UID Integer,
      WhenRecordedUTC TimeStamp,
      WhenRecorded TimeStamp) IN DATABASE;
EXECUTE PROCEDURE sp_CreateIndex90( 
   'SPS30_old',
   'SPS30_old.adi',
   'BYUID',
   'UID',
   '',
   2,
   512,
   '' ); 


EXECUTE PROCEDURE sp_CreateIndex90( 
   'SPS30_old',
   'SPS30_old.adi',
   'BYWHEN',
   'WhenRecordedUTC',
   '',
   2,
   512,
   '' ); 


EXECUTE PROCEDURE sp_ModifyTableProperty( 'SPS30_old', 
   'Table_Auto_Create', 
   'False', 'APPEND_FAIL', 'SPS30_oldfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'SPS30_old', 
   'Table_Permission_Level', 
   '2', 'APPEND_FAIL', 'SPS30_oldfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'SPS30_old', 
   'Triggers_Disabled', 
   'False', 'APPEND_FAIL', 'SPS30_oldfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'SPS30_old', 
   'Table_Trans_Free', 
   'False', 'APPEND_FAIL', 'SPS30_oldfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'SPS30_old', 
   'Table_WEB_delta', 
   'False', 'APPEND_FAIL', 'SPS30_oldfail');

CREATE TABLE DataTables3 ( 
      Name CIChar( 50 ),
      UID Integer,
      EarliestNew Date,
      NRows Integer) IN DATABASE;
EXECUTE PROCEDURE sp_CreateIndex90( 
   'DataTables3',
   'DataTables3.adi',
   'BYNAME',
   'Name; UID',
   '',
   2,
   512,
   '' ); 


EXECUTE PROCEDURE sp_ModifyTableProperty( 'DataTables3', 
   'Table_Auto_Create', 
   'False', 'APPEND_FAIL', 'DataTables3fail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'DataTables3', 
   'Table_Permission_Level', 
   '2', 'APPEND_FAIL', 'DataTables3fail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'DataTables3', 
   'Table_Memo_Block_Size', 
   '8', 'APPEND_FAIL', 'DataTables3fail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'DataTables3', 
   'Triggers_Disabled', 
   'False', 'APPEND_FAIL', 'DataTables3fail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'DataTables3', 
   'Table_Trans_Free', 
   'False', 'APPEND_FAIL', 'DataTables3fail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'DataTables3', 
   'Table_WEB_delta', 
   'False', 'APPEND_FAIL', 'DataTables3fail');

CREATE TABLE VC0706 ( 
      FileNumber Integer,
      ObservedUID Integer,
      WhenRecorded TimeStamp,
      WhenRecordedUTC TimeStamp,
      WhatMeasured Integer) IN DATABASE;
EXECUTE PROCEDURE sp_CreateIndex90( 
   'VC0706',
   'VC0706.adi',
   'BYFILENUMBER',
   'ObservedUID;FileNumber',
   '',
   2,
   512,
   '' ); 


EXECUTE PROCEDURE sp_CreateIndex90( 
   'VC0706',
   'VC0706.adi',
   'BYWHEN',
   'ObservedUID;WhenRecordedUTC',
   '',
   2,
   512,
   '' ); 


EXECUTE PROCEDURE sp_ModifyTableProperty( 'VC0706', 
   'Table_Auto_Create', 
   'False', 'APPEND_FAIL', 'VC0706fail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'VC0706', 
   'Table_Permission_Level', 
   '2', 'APPEND_FAIL', 'VC0706fail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'VC0706', 
   'Table_Memo_Block_Size', 
   '8', 'APPEND_FAIL', 'VC0706fail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'VC0706', 
   'Triggers_Disabled', 
   'False', 'APPEND_FAIL', 'VC0706fail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'VC0706', 
   'Table_Trans_Free', 
   'False', 'APPEND_FAIL', 'VC0706fail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'VC0706', 
   'Table_WEB_delta', 
   'False', 'APPEND_FAIL', 'VC0706fail');

EXECUTE PROCEDURE sp_ModifyFieldProperty ( 'VC0706', 
      'WhatMeasured', 'Comment', 
      'Motion or snap', 'APPEND_FAIL', 'VC0706fail' ); 

CREATE TABLE Thermostats ( 
      ObservedUID Integer,
      TargetF Double( 0 ),
      UID Integer,
      WhenRecorded TimeStamp,
      WhenRecordedUTC TimeStamp) IN DATABASE;
EXECUTE PROCEDURE sp_CreateIndex90( 
   'Thermostats',
   'Thermostats.adi',
   'BYWHEN',
   'WhenRecordedUTC',
   '',
   2,
   512,
   '' ); 


EXECUTE PROCEDURE sp_ModifyTableProperty( 'Thermostats', 
   'Table_Auto_Create', 
   'False', 'APPEND_FAIL', 'Thermostatsfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Thermostats', 
   'Table_Permission_Level', 
   '2', 'APPEND_FAIL', 'Thermostatsfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Thermostats', 
   'Table_Memo_Block_Size', 
   '8', 'APPEND_FAIL', 'Thermostatsfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Thermostats', 
   'Triggers_Disabled', 
   'False', 'APPEND_FAIL', 'Thermostatsfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Thermostats', 
   'Table_Trans_Free', 
   'False', 'APPEND_FAIL', 'Thermostatsfail');

EXECUTE PROCEDURE sp_ModifyTableProperty( 'Thermostats', 
   'Table_WEB_delta', 
   'False', 'APPEND_FAIL', 'Thermostatsfail');

EXECUTE PROCEDURE 
  sp_CreateLink ( 
     'HomeControl',
     '...\HomeControl.add',
     TRUE,
     FALSE,
     FALSE,
     '',
     ''/* YOUR PASSWORD GOES HERE */ );
EXECUTE PROCEDURE sp_ModifyPermission( 11, NULL, NULL, 'DB:Public', 2147483904, FALSE );

