have 2 sets of generated scripts sql replicated reporting databases 2 different versions of application.
the old application had 2300+ unnecessary tables (supported vendor's other products), not present in new version.
i need recreate functions, stored queries , views (maybe other stuff too) in new database. have definitions in generate scripts output individual .sql files. problem many of files contain references missing tables, want kind of dependency analysis list of things can't create because refer tables (and later views) don't exist.
i have list of missing tables in file, want use list of things search.
i need regex looks lines start "from " (and later inner join , left outer join) , followed 1 of missing table names (there may other text on line too, aliases.) i've used notepad++ force occurrences of |from|inner join|left inner join| @ start of new line.
i tried using findstr /g parameter have file full of regex patterns, doesn't seem match correctly.
eg findstr /i /r /g:mt.txt *.sql
mt.txt sample
^from\ action.* ^from\ actiongroup.* ^from\ actiontype.* i think issue related space after word from, when try use /c parameter of findstr says ignored.
i'm open using grep or perl solve if possible can offer.
Comments
Post a Comment