Advertisement
private775

Update strings table and environment

Feb 12th, 2018
329
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 0.83 KB | None | 0 0
  1. use K2;
  2. go
  3.  
  4. declare @httpOld nvarchar(255) = 'http://k2workspaceuat'
  5. declare @httpNew nvarchar(255) = 'http://k2uat'
  6.  
  7. declare @hostOld nvarchar(255) = 'Host=k2k2workspaceuat'
  8. declare @hostNew nvarchar(255) = 'Host=k2uat'
  9.  
  10. -- update string table with new server
  11. update  [Server].[StringTable]
  12. set value = REPLACE(value, @httpOld, @httpNew)
  13. where value like '%' + @httpOld + '%';
  14.  
  15. update  [Server].[StringTable]
  16. set value = REPLACE(value, @hostOld, @hostNew)
  17. where value like '%' + @hostOld + '%';
  18.  
  19. -- update environment table with new server
  20. update  [Environment].[FieldValue]
  21. set FieldValue = REPLACE(FieldValue, @httpOld, @httpNew)
  22. where FieldValue like '%' + @httpOld + '%';
  23.  
  24. update  [Environment].[FieldValue]
  25. set FieldValue = REPLACE(FieldValue, @hostOld, @hostNew)
  26. where FieldValue like '%' + @hostOld + '%';
  27.  
  28. go
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement