Thursday, August 26, 2021

MySQL: How to create Column if not exists?

https://dba.stackexchange.com/questions/169458/mysql-how-to-create-column-if-not-exists SELECT count(*) INTO @exist FROM information_schema.columns WHERE table_schema = 'mydatabase' and COLUMN_NAME = 'mycolumn' AND table_name = 'mytable' LIMIT 1; set @query = IF(@exist <= 0, 'ALTER TABLE mydatabase.`mytable` ADD COLUMN `mycolumn` MEDIUMTEXT NULL', 'select \'Column Exists\' status'); prepare stmt from @query; EXECUTE stmt;

Friday, July 16, 2021

Regular expression to find non-ascii characters in a large file in notepad++

Recently I face an issue while importing a large xml file because of a some invalid characters in XML content. Since it is a large file, the regular expression search in notepad++ helps to find the non ascii characters. [^\s\x20-\x7E] Thanks to :https://notepad-plus-plus.org/ , https://stackoverflow.com/questions/43334055/notepad-remove-non-alpanumeric-characters

Friday, May 21, 2021

Articles reference

https://hbr.org/2005/10/the-hard-side-of-change-management https://www.businesstoday.in/opinion/columns/6-billion---the-hidden-cost-of-90-day-notice-period-to-companies-economy/story/439603.html