Last active
January 18, 2022 09:08
-
-
Save kwestground/b93ea21f02a2b4c771cc2acd422b970b to your computer and use it in GitHub Desktop.
Migrate NopCommerce LocaleStringResource from one to another database
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
SELECT *, | |
CASE WHEN S1.ResourceName IS NULL THEN 'INSERT INTO LocaleStringResource VALUES ('+cast(S2.LanguageId as varchar)+', '''+S2.ResourceName+''', '''+REPLACE(S2.ResourceValue, '''', '''''')+''')' | |
ELSE 'UPDATE LocaleStringResource SET [ResourceValue] = '''+S2.ResourceValue+''' WHERE [ResourceName] = '''+S2.ResourceName+''' AND LanguageId='+cast(S2.LanguageId as varchar)+'' END AS [SQL] | |
FROM LocaleStringResource S1 | |
FULL OUTER JOIN NopCommerceStage.dbo.LocaleStringResource S2 ON S1.ResourceName=S2.ResourceName AND S1.LanguageId=S2.LanguageId | |
WHERE ISNULL(S1.ResourceValue, '') <> ISNULL(S2.ResourceValue, '') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment