擷取 Project Server 2003 移轉前的資料快照
適用版本: Project Server 2010
上次修改主題的時間: 2010-09-27
這個步驟執行 Script 3 以取得 Microsoft Office Project Server 2003 資料庫中「專案」和「任務」資料表的資料快照,然後儲存在此指令碼動態建立的資料表中。在執行此指令碼之前,請要求您的 SQL 資料庫管理員建立資料庫,這個資料庫將儲存數個資料驗證資料表,和用來驗證移轉後階段工作是否成功的內容。
要求 SQL 資料庫管理員建立資料庫並告知該名稱。
請在更新兩個 USE 陳述式之後執行此指令碼,以指向步驟 1 建立的資料庫和已可移轉的 Project Server 2003 資料庫名稱。
Script 3
/*---------------------------------------------------------------------------------------
-- Script A3: Capture Data Validation Snapshot for Project Server 2003 ---- Updated Jan 10, 2010
-- This script:
-- 1. drops the PS2003 Validation Snapshot table if it exists from the Migration Validation
Database previously created
2. Reads the Project Server 2003 SP2a database to extract Projects and Tasks information
3. Stores the output dataset into a new table created in the Migration Validation
Database
This script requires to set the database names of the Migration Validation Database and the
Project Server 2003 database in the USE statements
----------------------------------------------------------------------------------------------*/
USE ProjectServer_Migration_Data_Validation
IF EXISTS (SELECT id FROM dbo.sysobjects WHERE id = OBJECT_ID(N'MIgration_PS2003_Data_Validation_Snapshot')
AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.Migration_PS2003_Data_Validation_Snapshot
GO
USE [Proj2003SourceDB]
GO
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
GO
SELECT p11p.proj_name as N'Project Name',
p11p.proj_id as 'Project ID',
p11p.proj_version as N'Project Version',
p11p.proj_info_start_date as N'Proj Start Date',
p11p.proj_info_finish_date as N'Proj Finish Date',
p11p.proj_info_status_date as N'Proj Status Date',
p11p.proj_info_cal_name as N'Proj Calendar Name',
p11t.task_name as N'Task Name',
p11t.task_uid as N'Task UID',
p11t.task_type as N'Task Type',
p11t.task_start_date as N'Task Start Date',
p11t.task_finish_date as N'Task Finish Date',
p11t.task_act_start as N'Task Act Start',
p11t.task_act_finish as N'Task Act Finish',
p11t.task_constraint_date as N'Task Constraint Date',
p11t.task_deadline as N'Task Deadline',
p11t.task_work as N'Task Work',
p11t.task_act_work as N'Task Actual Work',
p11t.task_rem_work as N'Task Rem Work',
p11t.task_ovt_work as N'Task Ovt Work',
p11t.task_act_ovt_work as N'Task Actual Ovt Work',
p11t.task_rem_ovt_work as N'Task Rem Ovt Work',
p11t.task_pct_comp as N'Task %Complete',
p11t.task_pct_work_comp as N'Task %Work Complete',
p11t.task_phy_pct_comp as N'Task % Phys Work Complete',
p11t.task_dur as N'Task Duration',
p11t.task_rem_dur as N'Task Rem Duration',
p11t.task_act_dur as N'Task Actual Duration',
p11t.task_is_milestone as N'Task Milestone',
p11t.task_cost as N'Task Cost',
p11t.task_fixed_cost as N'Task Fixed Cost',
p11t.task_act_cost as N'Task Actual Cost',
p11t.task_rem_cost as N'Task Rem Cost',
p11t.task_ovt_cost as N'Task Ovt Cost',
p11t.task_act_ovt_cost as N'Task Actual Ovt Cost',
p11t.task_rem_ovt_cost as N'Task Rem Ovt Cost'
INTO ProjectServer_Migration_Data_Validation.dbo.Migration_PS2003_Data_Validation_Snapshot
FROM msp_projects AS p11p,
msp_tasks AS p11t
WHERE (p11p.proj_id = p11t.proj_id)
ORDER BY 1,5