Skip to content

Instantly share code, notes, and snippets.

@HugoRoca
Created November 11, 2020 15:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HugoRoca/b446b5d41275dc17fbf538269c7ab666 to your computer and use it in GitHub Desktop.
Save HugoRoca/b446b5d41275dc17fbf538269c7ab666 to your computer and use it in GitHub Desktop.
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