Created
August 20, 2010 14:06
-
-
Save jonezy/540385 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
prepends the client identifier to all occurences of a theme directory call | |
useful for when moving data from local to production | |
just update @ClientIdentifier to match the clients theme directory name. | |
WARNING: YOU HAVE TO MANUALLY SET THE LENGTH IN SUBSTRING(HtmlText, 0, 6) = @ClientIdentifier TO MATCH THE LENGTH OF THE @ClientIdentifier. | |
If you need to debug, just use this statement | |
SELECT CAST(REPLACE(CAST(HtmlText as nvarchar(max)), '/admin/theme/','/'+ @ClientIdentifier +'/admin/theme/') as ntext) FROM Html | |
*/ | |
DECLARE @ClientIdentifier nvarchar(max) | |
SET @ClientIdentifier = 'Xpert22' | |
UPDATE Html | |
SET HtmlText = CAST(REPLACE(CAST(HtmlText as nvarchar(max)),'/'+ @ClientIdentifier +'/admin/theme/', '/admin/theme/') as ntext) | |
WHERE SUBSTRING(HtmlText, 0, 6) = @ClientIdentifier |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment