Jump to content

Renaming a Production


Ipro_TannerComes

Recommended Posts

  • IPRO Employee

There is no way to rename a read-only completed production through the UI. To do this through SQL, follow the steps below. Please note this should only be done by someone who is skilled in SQL as this can cause database instability or corruption if done incorrectly:

 

Replace anything in brackets with the appropriate value:

 

 

First, back up the Production.Production table:

 

SELECT * INTO Production.Production_BAK_[Today's Date]

 

 

Then, run this one and take note of the ProductionID for the production you wish to change:

 

SELECT * FROM Production.Production

 

 

Finally, run this one to update it:

 

UPDATE Production.Production
SET ProductionName = '[The new production name]'
WHERE ProductionID = [The ProductionID].

 

 

Link to comment
Share on other sites

There is no way to rename a read-only completed production through the UI. To do this through SQL, follow the steps below. Please note this should only be done by someone who is skilled in SQL as this can cause database instability or corruption if done incorrectly:

 

Replace anything in brackets with the appropriate value:

 

 

First, back up the Production.Production table:

 

SELECT * INTO Production.Production_BAK_[Today's Date]

 

 

Then, run this one and take note of the ProductionID for the production you wish to change:

 

SELECT * FROM Production.Production

 

 

Finally, run this one to update it:

 

UPDATE Production.Production
SET ProductionName = '[The new production name]'
WHERE ProductionID = [The ProductionID].

 

 

This is nice Tanner; However, this script could be an easier solution.

 

Edit the Original Production Name and New Production Name variables and then run this on the Eclipse Case Database:

 

USE [EclipseCaseDatabaseHere]
SET NOCOUNT ON
DECLARE @OriginalProductionName nvarchar(256) = [OriginalProductionNameHere]
DECLARE @NewProductionName nvarchar(256) = [NewProductionNameHere]

DECLARE @NewProductionId int = 0

SET @NewProductionId = (SELECT ProductionId FROM Production.Production
WHERE ProductionName = @NewProductionName)
IF (@NewProductionId <> 0)
BEGIN
PRINT 'A production with the name ' + @NewProductionName + ' already exists'
END
ELSE
BEGIN
DECLARE @ProductionId int = 0
SET @ProductionId = (SELECT ProductionId FROM Production.Production
WHERE ProductionName = @OriginalProductionName)
IF (@ProductionId <> 0)
BEGIN
UPDATE Production.Production
SET ProductionName = @NewProductionName
WHERE ProductionId = @ProductionId

PRINT 'Production with name ' + @OriginalProductionName + ' has been changed to ' + @NewProductionName
END
ELSE
BEGIN
PRINT 'No production found with name ' + @OriginalProductionName
END
END

 

Thank you,

Levi Roble

Technical Support Engineer 2

Link to comment
Share on other sites

There is no way to rename a read-only completed production through the UI. To do this through SQL, follow the steps below. Please note this should only be done by someone who is skilled in SQL as this can cause database instability or corruption if done incorrectly:

 

Replace anything in brackets with the appropriate value:

 

 

First, back up the Production.Production table:

 

SELECT * INTO Production.Production_BAK_[Today's Date]

 

 

Then, run this one and take note of the ProductionID for the production you wish to change:

 

SELECT * FROM Production.Production

 

 

Finally, run this one to update it:

 

UPDATE Production.Production
SET ProductionName = '[The new production name]'
WHERE ProductionID = [The ProductionID].

 

 

This is nice Tanner; However, this script could be an easier solution.

 

Edit the Original Production Name and New Production Name variables and then run this on the Eclipse Case Database:

 

USE [EclipseCaseDatabaseHere]
SET NOCOUNT ON
DECLARE @OriginalProductionName nvarchar(256) = [OriginalProductionNameHere]
DECLARE @NewProductionName nvarchar(256) = [NewProductionNameHere]

DECLARE @NewProductionId int = 0

SET @NewProductionId = (SELECT ProductionId FROM Production.Production
WHERE ProductionName = @NewProductionName)
IF (@NewProductionId <> 0)
BEGIN
PRINT 'A production with the name ' + @NewProductionName + ' already exists'
END
ELSE
BEGIN
DECLARE @ProductionId int = 0
SET @ProductionId = (SELECT ProductionId FROM Production.Production
WHERE ProductionName = @OriginalProductionName)
IF (@ProductionId <> 0)
BEGIN
UPDATE Production.Production
SET ProductionName = @NewProductionName
WHERE ProductionId = @ProductionId

PRINT 'Production with name ' + @OriginalProductionName + ' has been changed to ' + @NewProductionName
END
ELSE
BEGIN
PRINT 'No production found with name ' + @OriginalProductionName
END
END

 

Thank you,

Levi Roble

Technical Support Engineer 2

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...