Question : DBDesigner 4 to MSSQL 2000

Hi experts ..

I'm trying to connect to MSSQL  2000 through DBDesigner4 to create some tables, the problem is that I couldn't connect to the database, could you please help me?

Answer : DBDesigner 4 to MSSQL 2000

CREATE TABLE account_history (
  account_history_id INTEGER  NOT NULL PRIMARY KEY,
  import_id INTEGER  NOT NULL,
  account_id INTEGER  NULL,
  account_status_id INTEGER  NOT NULL,
  ssn CHAR(9) NULL,
  specialist VARCHAR(100) NULL,
  local_office_id INTEGER  NOT NULL,
  balance BIGINT NULL,
  billable_balance DECIMAL NULL,
  collectible_balance DECIMAL NULL,
  suspension_reason_id INTEGER  NOT NULL,
  new_hire_status BIT NULL,
  last_quarter_wages DECIMAL NULL,
  last_closed_on SMALLDATETIME NULL,
  last_opened_on SMALLDATETIME NULL,
  age INTEGER  NULL,
  legal BIT NULL,
  garnish BIT NULL,
  minimum_payment DECIMAL NULL,
  min_payment_override BIT NULL,
  min_pmt_override_start_SMALLDATETIME SMALLDATETIME NULL,
  min_pmt_override_end_SMALLDATETIME SMALLDATETIME NULL,
  create_SMALLDATETIME DATETIME NULL,
  update_SMALLDATETIME DATETIME DEFAULT GETDATE(), -- AUTO_INCREMENT,
  severity INTEGER  NULL
)
GO
 
CREATE INDEX account_FKIndex2 ON account_history (local_office_id)
CREATE INDEX account_FKIndex3 ON account_history (suspension_reason_id)
CREATE INDEX account_history_FKIndex4 ON account_history (import_id)

GO
CREATE TABLE account_history_attribute (
  account_history_attribute_id INTEGER  IDENTITY PRIMARY KEY,
  account_history_history_id INTEGER  NOT NULL,
  attribute_name VARCHAR (100)NULL,
  attribute_value INTEGER  NULL,
  attribute_type VARCHAR (100)NULL,
)
GO
CREATE INDEX AccountAttribute_FKIndex1 ON account_history_attribute(account_history_history_id)
GO

CREATE TABLE account_status (
  account_status_id INTEGER  IDENTITY PRIMARY KEY,
  status_name VARCHAR (100)NULL,
  status_code CHAR NULL,
  status_description INTEGER  NULL
)

CREATE TABLE import_history (
  import_id INTEGER  IDENTITY PRIMARY KEY,
  import_SMALLDATETIME DATETIME NULL
);

CREATE TABLE local_office (
  local_office_id INTEGER  IDENTITY PRIMARY KEY,
  local_office_no VARCHAR (100)NULL
 
);

CREATE TABLE overpayment_history (
  overpayment_history_id INTEGER  IDENTITY PRIMARY KEY,
  overpayment_history_status_overpayment_history_status_id INTEGER  NOT NULL,
  account_history_history_id INTEGER  NOT NULL,
  amount DECIMAL NULL,
  billable_amount DECIMAL NULL,
  collectible_amount DECIMAL NULL,
  balance DECIMAL NULL,
  billable_balance DECIMAL NULL,
  collectible_balance DECIMAL NULL,
  establish_SMALLDATETIME DATETIME NULL,
  BYE DATETIME NULL,
  fraud BIT NULL,
  appeal_status CHAR(1) NULL,
  appeal_SMALLDATETIME DATETIME NULL,
  [current] BIT NULL,
  create_SMALLDATETIME DATETIME NULL
);

CREATE  INDEX Overpayment_FKIndex1 ON overpayment_history (account_history_history_id)
CREATE  INDEX overpayment_FKIndex2 ON overpayment_history (overpayment_history_status_overpayment_history_status_id)

GO
CREATE TABLE overpayment_history_attribute (
  overpayment_history_attribute_id INTEGER  IDENTITY  PRIMARY KEY,
  overpayment_history_history_id INTEGER  NOT NULL,
  attribute_name INTEGER  NULL,
  attribute_value INTEGER  NULL,
  attribute_type VARCHAR (100)NULL
);
CREATE   INDEX OverpaymentAttribute_FKIndex1 ON overpayment_history_attribute(overpayment_history_history_id)
GO
CREATE TABLE overpayment_status (
  overpayment_history_status_id INTEGER  IDENTITY PRIMARY KEY ,
  status_name VARCHAR (100)NULL,
  status_code CHAR NULL,
  status_description INTEGER  NULL
);

CREATE TABLE repayment_application_history (
  repayment_history_history_id INTEGER  NOT NULL,
  overpayment_history_history_id INTEGER  NOT NULL,
  application_amount BIGINT NULL,
  create_SMALLDATETIME DATETIME NULL
);
ALTER TABLE [dbo].[repayment_application_history] WITH NOCHECK ADD
      CONSTRAINT [PK_repayment_application_history] PRIMARY KEY  CLUSTERED
      (
            [repayment_history_history_id],
            [overpayment_history_history_id]
      )  ON [PRIMARY]
GO




CREATE INDEX RepaymentApplication_FKIndex1 ON repayment_application_history(repayment_history_history_id)
CREATE INDEX RepaymentApplication_FKIndex2 ON repayment_application_history(overpayment_history_history_id)


CREATE TABLE repayment_history (
  repayment_history_id INTEGER  IDENTITY PRIMARY KEY,
  account_history_history_id INTEGER  NOT NULL,
  amount INTEGER  NULL,
  is_offset BIT NULL,
  payment_SMALLDATETIME DATETIME NULL,
  create_SMALLDATETIME DATETIME NULL
);
CREATE INDEX Repayment_FKIndex1 ON repayment_history(account_history_history_id)
GO

CREATE TABLE repayment_history_attribute (
  repayment_history_attribute_id INTEGER  IDENTITY PRIMARY KEY,
  repayment_history_history_id INTEGER  NOT NULL,
  attribute_name VARCHAR (100)NULL,
  attribute_value VARCHAR (100)NULL
);
CREATE INDEX RepaymentAttribute_FKIndex1 ON repayment_history_attribute(repayment_history_history_id)
GO

CREATE TABLE suspension_reason (
  suspension_reason_id INTEGER  IDENTITY PRIMARY KEY,
  suspension_name VARCHAR (100)NULL,
  suspension_description VARCHAR (100)NULL
);


Random Solutions  
 
programming4us programming4us