IF NOT EXISTS (SELECT 1 FROM SYS.TABLES WHERE NAME='LD0P0MOUAssignmentIfoGoal')
BEGIN
CREATE TABLE LD0P0MOUAssignmentIfoGoal 
(
UPPDRAGIFONR DECIMAL(9) NOT NULL,
GOALID DECIMAL(9) NOT NULL,
UPDSIGN VARCHAR(10) NOT NULL,
UPDDAT VARCHAR(8) NOT NULL,
	CONSTRAINT LD0P0MOUAssignmentIfoGoal_PKID PRIMARY KEY CLUSTERED
	(
	UPPDRAGIFONR, GOALID
	)
)
END
GO

IF EXISTS (SELECT 1 FROM SYS.VIEWS WHERE NAME='LD0V0MOUAssignmentIfoGoal')
BEGIN
DROP VIEW LD0V0MOUAssignmentIfoGoal
END
GO

CREATE OR ALTER VIEW LD0V0MOUAssignmentIfoGoal AS SELECT * FROM LD0P0MOUAssignmentIfoGoal
GO
GRANT ALL ON LD0V0MOUAssignmentIfoGoal TO LD0ROANV
GO
