|
Forums
 | |  |
 | |  |
 | |  |
 | |  |
 | |  |
 |
|
|
|
I have updated the script and made the following changes:
- removed use database statement
- added checks and drop statements to all project temp tables
- removed drop dtproperties table.
|
|
|
|
 |  |
|
|
 |
Joined: 10/26/2009
Posts: 1
|
|
|
Hi,
on SQL Server 2008 I get the following errors executing the second script::
(1 row(s) affected)
Msg 2714, Level 16, State 6, Line 27
There is already an object named '#OldResolution' in the database.
(1 row(s) affected)
(0 row(s) affected)
Msg 547, Level 16, State 0, Line 3
The INSERT statement conflicted with the FOREIGN KEY constraint "FK_BugNet_IssueNotifications_BugNet_Issues". The conflict occurred in database "Tambien_BugNET_Test", table "dbo.BugNet_Issues", column 'IssueId'.
(1 row(s) affected)
Msg 8107, Level 16, State 1, Line 2
IDENTITY_INSERT is already ON for table 'Tambien_BugNET_Test.dbo.BugNet_IssueNotifications'. Cannot perform SET operation for table 'BugNet_IssueHistory'.
(1 row(s) affected)
Msg 8107, Level 16, State 1, Line 2
IDENTITY_INSERT is already ON for table 'Tambien_BugNET_Test.dbo.BugNet_IssueNotifications'. Cannot perform SET operation for table 'BugNet_IssueComments'.
(1 row(s) affected)
Msg 8107, Level 16, State 1, Line 2
IDENTITY_INSERT is already ON for table 'Tambien_BugNET_Test.dbo.BugNet_IssueNotifications'. Cannot perform SET operation for table 'BugNet_IssueAttachments'.
(1 row(s) affected)
(0 row(s) affected)
Msg 8107, Level 16, State 1, Line 2
IDENTITY_INSERT is already ON for table 'Tambien_BugNET_Test.dbo.BugNet_IssueNotifications'. Cannot perform SET operation for table 'BugNet_IssueWorkReports'.
(1 row(s) affected)
Msg 8107, Level 16, State 1, Line 2
IDENTITY_INSERT is already ON for table 'Tambien_BugNET_Test.dbo.BugNet_IssueNotifications'. Cannot perform SET operation for table 'BugNet_ProjectMailBoxes'.
|
|
|
|
 |  |
|
|
|
Tambien wrote
Hi,
on SQL Server 2008 I get the following errors executing the second script::
(1 row(s) affected)
Msg 2714, Level 16, State 6, Line 27
There is already an object named '#OldResolution' in the database.
(1 row(s) affected)
(0 row(s) affected)
Msg 547, Level 16, State 0, Line 3
The INSERT statement conflicted with the FOREIGN KEY constraint "FK_BugNet_IssueNotifications_BugNet_Issues". The conflict occurred in database "Tambien_BugNET_Test", table "dbo.BugNet_Issues", column 'IssueId'.
(1 row(s) affected)
Msg 8107, Level 16, State 1, Line 2
IDENTITY_INSERT is already ON for table 'Tambien_BugNET_Test.dbo.BugNet_IssueNotifications'. Cannot perform SET operation for table 'BugNet_IssueHistory'.
(1 row(s) affected)
Msg 8107, Level 16, State 1, Line 2
IDENTITY_INSERT is already ON for table 'Tambien_BugNET_Test.dbo.BugNet_IssueNotifications'. Cannot perform SET operation for table 'BugNet_IssueComments'.
(1 row(s) affected)
Msg 8107, Level 16, State 1, Line 2
IDENTITY_INSERT is already ON for table 'Tambien_BugNET_Test.dbo.BugNet_IssueNotifications'. Cannot perform SET operation for table 'BugNet_IssueAttachments'.
(1 row(s) affected)
(0 row(s) affected)
Msg 8107, Level 16, State 1, Line 2
IDENTITY_INSERT is already ON for table 'Tambien_BugNET_Test.dbo.BugNet_IssueNotifications'. Cannot perform SET operation for table 'BugNet_IssueWorkReports'.
(1 row(s) affected)
Msg 8107, Level 16, State 1, Line 2
IDENTITY_INSERT is already ON for table 'Tambien_BugNET_Test.dbo.BugNet_IssueNotifications'. Cannot perform SET operation for table 'BugNet_ProjectMailBoxes'.
I have updated the script and added a delete statement to clean up any orphaned bugnotification rows.
|
|
|
|
 |  |
|
|
 |
Joined: 10/26/2009
Posts: 2
|
|
|
Davin,
I modified your script for our system. Here is what we did, hope it helps. All transaction / error code was removed for clarity.
Dan
/*
DO NOT JUST BLINDLY RUN THIS SCRIPT... Review it and read the comments
And of course you are testing it out on a backup... right...
Run the script in this order
1. BugNet.Schema.SqlDataProvider.sql
2. BugNet.Data.SqlDataProvider.sql
3. this script (one block at a time)
4. uncomment the drops at the bottom and run them
*/
DELETE FROM UserRoles WHERE UserId NOT IN (SELECT U.UserId FROM aspnet_Users U)
DELETE FROM UserProjects WHERE UserId NOT IN (SELECT U.UserId FROM aspnet_Users U)
DELETE FROM RelatedBug WHERE LinkedBugID NOT IN (SELECT B.BugID FROM Bug B)
GO
SET IDENTITY_INSERT BugNet_Projects ON
INSERT BugNet_Projects
(
ProjectId,
ProjectName,
ProjectCode,
ProjectDescription,
AttachmentUploadPath,
DateCreated,
ProjectDisabled,
ProjectAccessType,
ProjectManagerUserId,
ProjectCreatorUserId,
AllowAttachments,
AttachmentStorageType,
SvnRepositoryUrl
)
SELECT
ProjectID,
Name,
Code,
Description,
UploadPath,
CreateDate,
CASE Active WHEN 1 THEN 0 ELSE 1 END AS ProjectDisabled, --flip the logic from 7 to 8
AccessType,
ManagerUserId,
CreatorUserId,
AllowAttachments,
1, --FileSystem
''
FROM
Project
SET IDENTITY_INSERT BugNet_Projects OFF
GO
SET IDENTITY_INSERT BugNet_UserProjects ON
INSERT BugNet_UserProjects
(
UserId,
ProjectId,
UserProjectId,
DateCreated
)
SELECT
UserId,
ProjectId,
UserProjectId,
GETDATE()
FROM
UserProjects where ProjectId in(select ProjectId from BugNet_Projects)and UserId in (select userid from aspnet_Users)
SET IDENTITY_INSERT BugNet_UserProjects OFF
GO
-- Copy Project Roles
SET IDENTITY_INSERT BugNet_Roles ON
INSERT BugNet_Roles
(
RoleId,
ProjectId,
RoleName,
RoleDescription,
AutoAssign
)
SELECT
RoleId,
ProjectId,
RoleName,
Description,
AutoAssign
FROM
Roles
SET IDENTITY_INSERT BugNet_Roles OFF
GO
INSERT BugNet_UserRoles
(
UserId,
RoleId
)
SELECT
UserId,
RoleId
FROM
UserRoles where UserId in (select userid from aspnet_Users)
GO
INSERT BugNet_RolePermissions
(
PermissionId,
RoleId
)
SELECT
PermissionId,
RoleId
FROM
RolePermission
GO
--Don't want all the old logs so it's commented it out
--SET IDENTITY_INSERT BugNet_ApplicationLog ON
-- INSERT BugNet_ApplicationLog
-- (
-- Id,
-- [Date],
-- Thread,
-- [Level],
-- Logger,
-- [User],
-- [Message],
-- [Exception]
-- )
-- SELECT
-- Id,
-- [Date],
-- Thread,
-- [Level],
-- Logger,
-- [User],
-- [Message],
-- [Exception]
-- FROM
-- [Log]
-- SET IDENTITY_INSERT BugNet_ApplicationLog OFF
-- Copy Host Settings
INSERT BugNet_HostSettings
(
SettingName,
SettingValue
)
SELECT
SettingName,
SettingValue
FROM
HostSettings
GO
SET IDENTITY_INSERT BugNet_ProjectCustomFields ON
INSERT BugNet_ProjectCustomFields
(
CustomFieldId,
ProjectId,
CustomFieldName,
CustomFieldRequired,
CustomFieldDataType,
CustomFieldTypeId
)
SELECT
CustomFieldId,
ProjectId,
CustomFieldName,
CustomFieldRequired,
CustomFieldDataType,
CustomFieldTypeId
FROM
ProjectCustomFields
SET IDENTITY_INSERT BugNet_ProjectCustomFields OFF
GO
SET IDENTITY_INSERT BugNet_ProjectCustomFieldSelections ON
INSERT BugNet_ProjectCustomFieldSelections
(
CustomFieldSelectionId,
CustomFieldId,
CustomFieldSelectionValue,
CustomFieldSelectionName,
CustomFieldSelectionSortOrder
)
SELECT
CustomFieldSelectionId,
CustomFieldId,
CustomFieldSelectionValue,
CustomFieldSelectionName,
CustomFieldSelectionSortOrder
FROM
ProjectCustomFieldSelection
SET IDENTITY_INSERT BugNet_ProjectCustomFieldSelections OFF
GO
SET IDENTITY_INSERT BugNet_ProjectCategories ON
INSERT BugNet_ProjectCategories
(
CategoryId,
CategoryName,
ProjectId,
ParentCategoryId
)
SELECT
ComponentID,
Name,
ProjectID,
ParentComponentID
FROM
Component where ProjectId in(select ProjectId from BugNet_Projects)
SET IDENTITY_INSERT BugNet_ProjectCategories OFF
GO
SET IDENTITY_INSERT BugNet_ProjectMilestones ON
INSERT BugNet_ProjectMilestones
(
MilestoneId,
MilestoneName,
ProjectId,
MilestoneImageUrl,
SortOrder,
DateCreated,
MilestoneDueDate
)
SELECT
VersionID,
Name,
ProjectID,
'',
0,
GETDATE(),
NULL
FROM
[VERSION]
SET IDENTITY_INSERT BugNet_ProjectMilestones OFF
--------------------------------------------------------------------------------
--- original loop was below here, removed most of the temp tables and the loop
/*
use a Cartesian product to get all the possible combinations
also set a counter using the ROW_NUMBER() function
and use the existing sort order of the old id as the new sort order
Somthing like this could be used instead of the case statements
for the images below
SELECT RIGHT(ImageUrl, CHARINDEX ('/',REVERSE(ImageUrl))-1) FROM [Type]
*/
SET IDENTITY_INSERT BugNet_ProjectResolutions ON
INSERT BugNet_ProjectResolutions
(
ResolutionId,
ProjectId,
ResolutionName,
ResolutionImageUrl,
SortOrder
)
SELECT ROW_NUMBER() OVER (ORDER BY BugNet_Projects.ProjectId,Resolution.ResolutionID) AS ResolutionId,
BugNet_Projects.ProjectId,
Resolution.Name as ResolutionName,
CASE Resolution.ResolutionID
WHEN 6 THEN 'accept.gif'
ELSE '' END
AS ResolutionImageUrl,
Resolution.ResolutionID as SortOrder
FROM Resolution CROSS JOIN BugNet_Projects
SET IDENTITY_INSERT BugNet_ProjectResolutions OFF
GO
SET IDENTITY_INSERT BugNet_ProjectIssueTypes ON
INSERT BugNet_ProjectIssueTypes
(
IssueTypeId,
ProjectId,
IssueTypeName,
IssueTypeImageUrl,
SortOrder
)
SELECT ROW_NUMBER() OVER (ORDER BY BugNet_Projects.ProjectId,[TYPE].TypeID) AS IssueTypeId,
BugNet_Projects.ProjectId,
[TYPE].Name as IssueTypeName,
CASE [TYPE].TypeID
WHEN 1 THEN 'Any.gif'
WHEN 2 THEN 'Bug.gif'
WHEN 3 THEN 'NewFeature.gif'
WHEN 4 THEN 'Task.gif'
WHEN 5 THEN 'Improvement.gif'
ELSE '' END
AS IssueTypeImageUrl,
[TYPE].TypeID as SortOrder
FROM [TYPE] CROSS JOIN BugNet_Projects
SET IDENTITY_INSERT BugNet_ProjectIssueTypes OFF
GO
--my color choices below
SET IDENTITY_INSERT BugNet_ProjectStatus ON
INSERT BugNet_ProjectStatus
(
StatusId,
ProjectId,
StatusName,
StatusImageUrl,
SortOrder,
IsClosedState
)
SELECT ROW_NUMBER() OVER (ORDER BY BugNet_Projects.ProjectId,[Status].StatusId) AS StatusId,
BugNet_Projects.ProjectId,
[Status].Name as StatusName,
CASE [Status].StatusId
WHEN 1 THEN '02.png' --Open, green
WHEN 2 THEN '03.png' --In Progress, blue
WHEN 3 THEN '04.png' --On-Hold, yellow
WHEN 4 THEN '09.png' --Resolved, light grey
WHEN 5 THEN '08.png' --Closed, dark grey
ELSE '' END
AS StatusImageUrl,
[Status].StatusId as SortOrder,
0 as IsClosedState
FROM [Status] CROSS JOIN BugNet_Projects
SET IDENTITY_INSERT BugNet_ProjectStatus OFF
GO
SET IDENTITY_INSERT BugNet_ProjectPriorities ON
INSERT BugNet_ProjectPriorities
(
PriorityID,
ProjectId,
PriorityName,
PriorityImageUrl,
SortOrder
)
SELECT ROW_NUMBER() OVER (ORDER BY BugNet_Projects.ProjectId,[Priority].PriorityID) AS PriorityID,
BugNet_Projects.ProjectId,
[Priority].Name as PriorityName,
CASE [Priority].PriorityID
WHEN 1 THEN 'Blocker.gif'
WHEN 2 THEN 'Critical.gif'
WHEN 3 THEN 'Major.gif'
WHEN 4 THEN 'Minor.gif'
WHEN 5 THEN 'Trivial.gif'
ELSE '' END
AS PriorityImageUrl,
[Priority].PriorityID as SortOrder
FROM [Priority] CROSS JOIN BugNet_Projects
SET IDENTITY_INSERT BugNet_ProjectPriorities OFF
GO
CREATE TABLE #NewIssues
(
[IssueId] INT,
[IssueTitle] NVARCHAR(500),
[IssueDescription] NVARCHAR(MAX) ,
[IssueStatusId] INT,
[IssuePriorityId] INT,
[IssueTypeId] INT,
[IssueCategoryId] INT,
[ProjectId] INT,
[IssueAffectedMilestoneId] INT,
[IssueResolutionId] INT,
[IssueCreatorUserId] UNIQUEIDENTIFIER,
[IssueAssignedUserId] UNIQUEIDENTIFIER,
[IssueOwnerUserId] UNIQUEIDENTIFIER,
[IssueDueDate] DATETIME,
[IssueMilestoneId] INT,
[IssueVisibility] INT,
[IssueEstimation] DECIMAL(5, 2),
[IssueProgress] INT,
[DateCreated] DATETIME,
[LastUpdate] DATETIME,
[LastUpdateUserId] UNIQUEIDENTIFIER,
[Disabled] BIT
)
INSERT #NewIssues
(
IssueId,
IssueTitle,
IssueDescription,
IssueStatusId,
IssuePriorityId,
IssueTypeId,
IssueCategoryId,
ProjectId,
IssueAffectedMilestoneId,
IssueResolutionId,
IssueCreatorUserId,
IssueAssignedUserId,
IssueOwnerUserId,
IssueDueDate,
IssueMilestoneId,
IssueVisibility,
IssueEstimation,
IssueProgress,
DateCreated,
LastUpdate,
LastUpdateUserId,
[Disabled]
)
SELECT
BugId,
Summary,
CAST([Description] AS NVARCHAR(MAX)) AS [Description],
(select StatusId from BugNet_ProjectStatus as s where s.ProjectId = Bug.ProjectId and s.SortOrder = Bug.StatusId) as StatusId,
(SELECT PriorityId FROM BugNet_ProjectPriorities as p where p.ProjectId = Bug.ProjectId and p.SortOrder = Bug.PriorityId) as PriorityId,
(SELECT IssueTypeId FROM BugNet_ProjectIssueTypes as t where t.ProjectId = Bug.ProjectId and t.SortOrder = Bug.TypeID) as TypeId,
ComponentID,
ProjectID,
CASE FixedInVersionId
when -1 then null --when no version was set the value will be -1 and break the fk so null it out
--when 5 then null -- missing on my system
--when 7 then null -- missing on my system
ELSE FixedInVersionId
END
AS FixedInVersionId,
(SELECT ResolutionId FROM BugNet_ProjectResolutions as r where r.ProjectId = Bug.ProjectId and r.SortOrder = Bug.ResolutionID) as ResolutionID,
ReporterUserId,
AssignedToUserId,
ReporterUserId,
DueDate,
VersionID,
Visibility,
Estimation,
0,
ReportedDate,
LastUpdate,
LastUpdateUserId,
0
FROM
Bug
GO
SET IDENTITY_INSERT BugNet_Issues ON
INSERT BugNet_Issues
(
IssueId,
IssueTitle,
IssueDescription,
IssueStatusId,
IssuePriorityId,
IssueTypeId,
IssueCategoryId,
ProjectId,
IssueAffectedMilestoneId,
IssueResolutionId,
IssueCreatorUserId,
IssueAssignedUserId,
IssueOwnerUserId,
IssueDueDate,
IssueMilestoneId,
IssueVisibility,
IssueEstimation,
IssueProgress,
DateCreated,
LastUpdate,
LastUpdateUserId,
[Disabled]
)
SELECT
IssueId,
IssueTitle,
IssueDescription,
IssueStatusId,
IssuePriorityId,
IssueTypeId,
IssueCategoryId,
ProjectId,
IssueAffectedMilestoneId,
IssueResolutionId,
IssueCreatorUserId,
IssueAssignedUserId,
IssueOwnerUserId,
IssueDueDate,
IssueMilestoneId,
IssueVisibility,
IssueEstimation,
IssueProgress,
DateCreated,
LastUpdate,
LastUpdateUserId,
[Disabled]
FROM
#NewIssues
SET IDENTITY_INSERT BugNet_Issues OFF
drop table #NewIssues
GO
--loop was above here
-------------------------------------------------------------------------
-- Copy Custom Field Values
SET IDENTITY_INSERT BugNet_ProjectCustomFieldValues ON
INSERT BugNet_ProjectCustomFieldValues
(
CustomFieldValueId,
IssueId,
CustomFieldId,
CustomFieldValue
)
SELECT
CustomFieldValueId,
BugId,
CustomFieldId,
CustomFieldValue
FROM
ProjectCustomFieldValues
SET IDENTITY_INSERT BugNet_ProjectCustomFieldValues OFF
GO
/*
We had one orphaned user here so I just delete it before the copy
delete BugNotification where CreatedUserId= '23DD8832-470E-4744-951F-094532A2C579'
use this to find them
select CreatedUserId from BugNotification
except
select UserId from aspnet_Users
*/
SET IDENTITY_INSERT BugNet_IssueNotifications ON
INSERT BugNet_IssueNotifications
(
IssueNotificationId,
IssueId,
UserId
)
SELECT
BugNotificationID,
BugID,
CreatedUserId
FROM
BugNotification
SET IDENTITY_INSERT BugNet_IssueNotifications OFF
GO
SET IDENTITY_INSERT BugNet_IssueHistory ON
INSERT BugNet_IssueHistory
(
IssueHistoryId,
IssueId,
FieldChanged,
OldValue,
NewValue,
DateCreated,
UserId
)
SELECT
BugHistoryID,
BugID,
FieldChanged,
OldValue,
NewValue,
CreatedDate,
CreatedUserId
FROM
BugHistory
SET IDENTITY_INSERT BugNet_IssueHistory OFF
GO
SET IDENTITY_INSERT BugNet_IssueComments ON
INSERT BugNet_IssueComments
(
IssueCommentId,
IssueId,
DateCreated,
Comment,
UserId
)
SELECT
BugCommentID,
BugID,
CreatedDate,
Comment,
CreatedUserId
FROM
BugComment
SET IDENTITY_INSERT BugNet_IssueComments OFF
GO
SET IDENTITY_INSERT BugNet_IssueAttachments ON
INSERT BugNet_IssueAttachments
(
IssueAttachmentId,
IssueId,
[FileName],
[Description],
FileSize,
ContentType,
DateCreated,
UserId,
Attachment
)
SELECT
BugAttachmentID,
BugID,
[FileName],
[Description],
FileSize,
[TYPE],
UploadedDate,
UploadedUserId,
NULL
FROM
BugAttachment
SET IDENTITY_INSERT BugNet_IssueAttachments OFF
GO
INSERT BugNet_RelatedIssues
(
PrimaryIssueId,
SecondaryIssueId,
RelationType
)
SELECT
BugID,
LinkedBugID,
1
FROM
RelatedBug
GO
SET IDENTITY_INSERT BugNet_IssueWorkReports ON
INSERT BugNet_IssueWorkReports
(
IssueWorkReportId,
IssueId,
WorkDate,
Duration,
IssueCommentId,
UserId
)
SELECT
BugTimeEntryId,
BugID,
WorkDate,
Duration,
BugCommentId,
CreatedUserId
FROM
BugTimeEntry
SET IDENTITY_INSERT BugNet_IssueWorkReports OFF
GO
SET IDENTITY_INSERT BugNet_ProjectMailBoxes ON
INSERT BugNet_ProjectMailBoxes
(
ProjectMailboxId,
Mailbox,
ProjectId,
AssignToUserId,
IssueTypeId
)
SELECT
ProjectMailboxId,
MailBox,
ProjectId,
AssignToUserId,
IssueTypeId
FROM
ProjectMailBox
SET IDENTITY_INSERT BugNet_ProjectMailBoxes OFF
GO
--DROP ALL OLD OBJECTS
/*
-- if we get here then we realy don't care if these fail so I don't
-- see a reason for all the transaction / error code , just removed it all
-- run multiple times and just ignor errors
DROP PROCEDURE [dbo].[BugNet_Bug_GetChangeLog]
DROP PROCEDURE [dbo].[BugNet_Bug_GetRoadMapProgress]
DROP PROCEDURE [dbo].[BugNet_ApplicationLog_GetLogCount]
DROP PROCEDURE [dbo].[BugNet_Attachment_CreateNewAttachment]
DROP PROCEDURE [dbo].[BugNet_Attachment_DeleteAttachment]
DROP PROCEDURE [dbo].[BugNet_Attachment_GetAttachmentById]
DROP PROCEDURE [dbo].[BugNet_Attachment_GetAttachmentsByBugId]
DROP PROCEDURE [dbo].[BugNet_Bug_CreateNewBug]
DROP PROCEDURE [dbo].[BugNet_Bug_Delete]
DROP PROCEDURE [dbo].[BugNet_Bug_GetBugComponentCountByProject]
DROP PROCEDURE [dbo].[BugNet_Bug_GetBugPriorityCountByProject]
DROP PROCEDURE [dbo].[BugNet_Bug_GetBugsByCriteria]
DROP PROCEDURE [dbo].[BugNet_Bug_GetBugStatusCountByProject]
DROP PROCEDURE [dbo].[BugNet_Bug_GetBugTypeCountByProject]
DROP PROCEDURE [dbo].[BugNet_Bug_GetBugUnassignedCountByProject]
DROP PROCEDURE [dbo].[BugNet_Bug_GetBugUserCountByProject]
DROP PROCEDURE [dbo].[BugNet_Bug_GetBugVersionCountByProject]
DROP PROCEDURE [dbo].[BugNet_Bug_GetMonitoredBugsByUser]
DROP PROCEDURE [dbo].[BugNet_Bug_GetRoadMap]
DROP PROCEDURE [dbo].[BugNet_Bug_UpdateBug]
DROP PROCEDURE [dbo].[BugNet_BugNotification_CreateNewBugNotification]
DROP PROCEDURE [dbo].[BugNet_BugNotification_DeleteBugNotification]
DROP PROCEDURE [dbo].[BugNet_BugNotification_GetBugNotificationsByBugId]
DROP PROCEDURE [dbo].[BugNet_Comment_CreateNewComment]
DROP PROCEDURE [dbo].[BugNet_Comment_DeleteComment]
DROP PROCEDURE [dbo].[BugNet_Comment_GetCommentById]
DROP PROCEDURE [dbo].[BugNet_Comment_GetCommentsByBugId]
DROP PROCEDURE [dbo].[BugNet_Comment_UpdateComment]
DROP PROCEDURE [dbo].[BugNet_Component_CreateNewComponent]
DROP PROCEDURE [dbo].[BugNet_Component_DeleteComponent]
DROP PROCEDURE [dbo].[BugNet_Component_GetChildComponentsByComponentId]
DROP PROCEDURE [dbo].[BugNet_Component_GetComponentById]
DROP PROCEDURE [dbo].[BugNet_Component_GetComponentsByProjectId]
DROP PROCEDURE [dbo].[BugNet_Component_GetRootComponentsByProjectId]
DROP PROCEDURE [dbo].[BugNet_Component_UpdateComponent]
DROP PROCEDURE [dbo].[BugNet_CustomField_CreateNewCustomField]
DROP PROCEDURE [dbo].[BugNet_CustomField_DeleteCustomField]
DROP PROCEDURE [dbo].[BugNet_CustomField_GetCustomFieldsByBugId]
DROP PROCEDURE [dbo].[BugNet_CustomField_GetCustomFieldsByProjectId]
DROP PROCEDURE [dbo].[BugNet_CustomField_SaveCustomFieldValue]
DROP PROCEDURE [dbo].[BugNet_CustomFieldSelection_CreateNewCustomFieldSelection]
DROP PROCEDURE [dbo].[BugNet_CustomFieldSelection_DeleteCustomFieldSelection]
DROP PROCEDURE [dbo].[BugNet_CustomFieldSelection_GetCustomFieldSelection]
DROP PROCEDURE [dbo].[BugNet_CustomFieldSelection_GetCustomFieldSelectionsByCustomFieldId]
DROP PROCEDURE [dbo].[BugNet_CustomFieldSelection_Update]
DROP PROCEDURE [dbo].[BugNet_History_CreateNewHistory]
DROP PROCEDURE [dbo].[BugNet_History_GetHistoryByBugId]
DROP PROCEDURE [dbo].[BugNet_HostSettings_GetHostSettings]
DROP PROCEDURE [dbo].[BugNet_HostSettings_UpdateHostSetting]
DROP PROCEDURE [dbo].[BugNet_Priority_GetAllPriorities]
DROP PROCEDURE [dbo].[BugNet_Priority_GetPriorityById]
DROP PROCEDURE [dbo].[BugNet_Project_GetProjectsByUserName]
DROP PROCEDURE [dbo].[BugNet_RelatedBug_CreateNewRelatedBug]
DROP PROCEDURE [dbo].[BugNet_RelatedBug_DeleteRelatedBug]
DROP PROCEDURE [dbo].[BugNet_RelatedBug_GetRelatedBugsByBugId]
DROP PROCEDURE [dbo].[BugNet_Resolution_GetAllResolutions]
DROP PROCEDURE [dbo].[BugNet_Resolution_GetResolutionById]
DROP PROCEDURE [dbo].[BugNet_Status_GetAllStatus]
DROP PROCEDURE [dbo].[BugNet_Status_GetStatusById]
DROP PROCEDURE [dbo].[BugNet_TimeEntry_CreateNewTimeEntry]
DROP PROCEDURE [dbo].[BugNet_TimeEntry_DeleteTimeEntry]
DROP PROCEDURE [dbo].[BugNet_TimeEntry_GetProjectWorkerWorkReport]
DROP PROCEDURE [dbo].[BugNet_TimeEntry_GetWorkerOverallWorkReportByWorkerId]
DROP PROCEDURE [dbo].[BugNet_TimeEntry_GetWorkReportByBugId]
DROP PROCEDURE [dbo].[BugNet_TimeEntry_GetWorkReportByProjectId]
DROP PROCEDURE [dbo].[BugNet_Type_GetAllTypes]
DROP PROCEDURE [dbo].[BugNet_Type_GetTypeById]
DROP PROCEDURE [dbo].[BugNet_Version_CreateNewVersion]
DROP PROCEDURE [dbo].[BugNet_Version_DeleteVersion]
DROP PROCEDURE [dbo].[BugNet_Version_GetVersionById]
DROP PROCEDURE [dbo].[BugNet_Version_GetVersionByProjectId]
DROP PROCEDURE [dbo].[BugNet_Version_Update]
DROP PROCEDURE [dbo].[BugNet_Bug_GetBugById]
DROP PROCEDURE [dbo].[BugNet_Bug_GetBugsByProjectId]
DROP PROCEDURE [dbo].[BugNet_Bug_GetRecentlyAddedBugsByProject]
DROP VIEW [dbo].[BugsView]
DROP TABLE [dbo].[Bug]
DROP TABLE [dbo].[BugAttachment]
DROP TABLE [dbo].[BugComment]
DROP TABLE [dbo].[BugHistory]
DROP TABLE [dbo].[BugNotification]
DROP TABLE [dbo].[BugTimeEntry]
DROP TABLE [dbo].[Component]
DROP TABLE [dbo].[dtproperties]
DROP TABLE [dbo].[HostSettings]
DROP TABLE [dbo].[Log]
DROP TABLE [dbo].[Permission]
DROP TABLE [dbo].[Priority]
DROP TABLE [dbo].[Project]
DROP TABLE [dbo].[ProjectCustomFields]
DROP TABLE [dbo].[ProjectCustomFieldSelection]
DROP TABLE [dbo].[ProjectCustomFieldType]
DROP TABLE [dbo].[ProjectCustomFieldValues]
DROP TABLE [dbo].[ProjectMailBox]
DROP TABLE [dbo].[RelatedBug]
DROP TABLE [dbo].[Resolution]
DROP TABLE [dbo].[RolePermission]
DROP TABLE [dbo].[Roles]
DROP TABLE [dbo].[Status]
DROP TABLE [dbo].[Type]
DROP TABLE [dbo].[UserProjects]
DROP TABLE [dbo].[UserRoles]
DROP TABLE [dbo].[Version]
*/
|
|
|
|
 |  |
|
|
|
Hi Davin,
The first script executed fine, but the second script gave this error after a whole bunch of "<n> rows affected" commands.
I ran the script I downloaded at 14:00 GMT yesterday so dont know if the script changed after that.
(3 row(s) affected)
Msg 2714, Level 16, State 6, Line 27
There is already an object named '#OldResolution' in the database.
(1 row(s) affected)
Msg 547, Level 16, State 0, Line 3
The INSERT statement conflicted with the FOREIGN KEY constraint "FK_BugNet_ProjectCustomFieldValues_BugNet_Issues". The conflict occurred in database "BugNET0.8", table "dbo.BugNet_Issues", column 'IssueId'.
(1 row(s) affected)
Msg 8107, Level 16, State 1, Line 2
IDENTITY_INSERT is already ON for table 'BugNET0.8.dbo.BugNet_ProjectCustomFieldValues'. Cannot perform SET operation for table 'BugNet_IssueNotifications'.
(1 row(s) affected)
Msg 8107, Level 16, State 1, Line 2
IDENTITY_INSERT is already ON for table 'BugNET0.8.dbo.BugNet_ProjectCustomFieldValues'. Cannot perform SET operation for table 'BugNet_IssueHistory'.
(1 row(s) affected)
Msg 8107, Level 16, State 1, Line 2
IDENTITY_INSERT is already ON for table 'BugNET0.8.dbo.BugNet_ProjectCustomFieldValues'. Cannot perform SET operation for table 'BugNet_IssueComments'.
(1 row(s) affected)
Msg 8107, Level 16, State 1, Line 2
IDENTITY_INSERT is already ON for table 'BugNET0.8.dbo.BugNet_ProjectCustomFieldValues'. Cannot perform SET operation for table 'BugNet_IssueAttachments'.
(1 row(s) affected)
Msg 547, Level 16, State 0, Line 2
The INSERT statement conflicted with the FOREIGN KEY constraint "FK_BugNet_RelatedIssues_BugNet_Issues". The conflict occurred in database "BugNET0.8", table "dbo.BugNet_Issues", column 'IssueId'.
(1 row(s) affected)
Msg 8107, Level 16, State 1, Line 2
IDENTITY_INSERT is already ON for table 'BugNET0.8.dbo.BugNet_ProjectCustomFieldValues'. Cannot perform SET operation for table 'BugNet_IssueWorkReports'.
(1 row(s) affected)
Msg 8107, Level 16, State 1, Line 2
IDENTITY_INSERT is already ON for table 'BugNET0.8.dbo.BugNet_ProjectCustomFieldValues'. Cannot perform SET operation for table 'BugNet_ProjectMailBoxes'.
(1 row(s) affected)
(9 row(s) affected)
Database synchronization script failed
|
|
|
|
|  |
 | |  |
 | |  |
 | |  |
|
| |
Forum Policy
These Discussion Forums are dedicated to the discussion of the BugNET issue tracker.
For the benefit of the community and to protect the integrity of the project, please observe the following posting guidelines:
1. No Advertising.
2. No Flaming or Trolling.
3. No Profanity, Racism, or Prejudice.
4. Site Moderators have the final word on approving/removing a thread or post or comment.
5. English language posting only, please.
|
|