/*Dodanie wszystkich ktorych nie ma*/
select
'insert into translation (translationid) values (N''' + replace(translationid,'''','''''') + ''');
GO'
from translation
union all
/*aktualizuj tylko jesli puste jelsi ktos sobie wprowadzil tluamcznei eni aktualizuj*/
select 'update translation set pl = N''' + replace(pl,'''','''''') + ''' where isnull(pl,'''') = '''' and translationid=N''' + translationid + ''' ;'
from translation where isnull(pl,'') <> ''
union all
select 'update translation set ru = N''' + replace(ru,'''','''''') + ''' where isnull(ru,'''') = '''' and translationid=N''' + translationid + ''' ;'
from translation where isnull(ru,'') <> ''
union all
select 'update translation set de = N''' + replace(de,'''','''''') + ''' where isnull(de,'''') = '''' and translationid=N''' + translationid + ''' ;'
from translation where isnull(de,'') <> ''
union all
select 'update translation set en = N''' + replace(en,'''','''''') + ''' where isnull(en,'''') = '''' and translationid=N''' + translationid + ''' ;'
from translation where isnull(en,'') <> ''