Created
November 11, 2020 15:16
-
-
Save HugoRoca/b446b5d41275dc17fbf538269c7ab666 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
select * from ['material-PA$'] | |
update ['material-PA$'] set Categoría = 'Maquillaje' where Categoría = 'MAQUILLAJE' | |
update ['material-PA$'] set Categoría = 'Fragancias' where Categoría = 'FRAGANCIAS' | |
update ['material-PA$'] set Categoría = 'Tratamiento Facial' where Categoría = 'TRATAMIENTO FACIAL' | |
update ['material-PA$'] set Categoría = 'Cuidado Personal' where Categoría = 'CUIDADO PERSONAL' | |
-- que todos tengan la extención | |
update ['material-PA$'] set Miniatura = 'Portada Antibacterial(1).jpg' where Miniatura = 'Portada Antibacterial(1)' | |
-- ver que las categorías hagan match | |
-- query | |
-- genera el insert complete | |
select Nro, 'INSERT INTO shareableMaterial (campaign, title, image, caption, brands, categories, content_type, material_type, previewImage, status) values ( | |
''' + CONVERT(varchar, Campaña) + ''', | |
N''' + Título + ''', | |
N''' + Nombre_Archivo + ''', | |
N''' + Caption + ''', | |
N''' + UPPER(rtrim(Marca)) + ''', | |
N''' + rtrim(Categoría) + ''', | |
N''' + rtrim(Tipo_Contenido) + ''', | |
''' + UPPER(rtrim(Tipo_Material)) + ''', | |
''' + isnull(Miniatura,'') + ''', | |
''1'')' from ['material-PA$'] | |
-- new page | |
use mexico | |
validacion no existe material c18 | |
insert into de c17 a c18 | |
todo el insert generado |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment