--******************************************************************************************************
-- VERY IMPORTANT - PLEASE READ!
-- This script to be used in place of PJCRTSPS.SQL ONLY when setting up seperate Main and WinProj Database Servers
--
-- This script (PJCRTSP2.SQL) must be run on the PWA database server
--******************************************************************************************************

IF EXISTS (SELECT id FROM dbo.sysobjects WHERE id = OBJECT_ID(N'dbo.MSP_PDS_SP_INSERT_MIN')
AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
DROP PROCEDURE dbo.MSP_PDS_SP_INSERT_MIN
GO


CREATE PROCEDURE dbo.MSP_PDS_SP_INSERT_MIN
	@ProjID INTEGER
AS
	EXECUTE dbo.MSP_PDS_SP_INSERT_TASK_MIN @ProjID
	EXECUTE dbo.MSP_PDS_SP_INSERT_RESOURCE_MIN @ProjID
	EXECUTE dbo.MSP_PDS_SP_INSERT_OUTLINE_CODE_MIN @ProjID
	EXECUTE dbo.MSP_PDS_SP_INSERT_CALENDAR_MIN @ProjID
	
      -- For the following proc you must fully qualify the WinProj server and database since it will be referenced across a linked server. Here's the format and an example
      -- Format: EXECUTE <WinProjServerName>.<WinProjDatabaseName>.dbo.MSP_PDS_SP_INSERT_PROJECT_BINARY @ProjID
      EXECUTE PSProj.ProjectServerPROJ.dbo.MSP_PDS_SP_INSERT_PROJECT_BINARY @ProjID

GO

GRANT EXECUTE ON dbo.MSP_PDS_SP_INSERT_MIN TO MSProjectServerRole
GO

