IF EXISTS (SELECT 1 FROM SYS.TABLES WHERE NAME='LD0P0N901')
BEGIN
DROP TABLE LD0P0N901
END
;
IF EXISTS (SELECT 1 FROM SYS.VIEWS WHERE NAME='LD0V0N901')
BEGIN
DROP VIEW LD0V0N901
END
;
IF EXISTS (SELECT 1 FROM SYS.VIEWS WHERE NAME='LD0VYN901')
BEGIN
DROP VIEW LD0VYN901
END
;
CREATE TABLE LD0P0N901
(
DELUPPDRAGNR    DECIMAL(9) NOT NULL,
UPPDRAGIFONR    DECIMAL(9) NOT NULL,
BEHANDLSATT     DECIMAL(9) NOT NULL,
UTFHAND         VARCHAR(10) NOT NULL,
UTFMEDHAND      VARCHAR(10) NOT NULL,
UTFMEDHAND2     VARCHAR(10) NOT NULL,
ORGID           DECIMAL(9) NOT NULL,
ORGENHNR        VARCHAR(10) NOT NULL,
FOMDAT          VARCHAR(8) NOT NULL,
TOMDAT          VARCHAR(8) NOT NULL,
UPDDAT          VARCHAR(8) NOT NULL,
UPDSIGN         VARCHAR(10) NOT NULL
)
;
CREATE  UNIQUE CLUSTERED INDEX LD0C0N901 ON LD0P0N901
(
    DELUPPDRAGNR
);
CREATE VIEW LD0V0N901
    AS SELECT * FROM LD0P0N901
;
CREATE VIEW LD0VYN901
    AS SELECT * FROM LD0P0N901
;
