Month: February 2022
-
Replace Blank CELLs with NULL Value
SELECT ‘UPDATE table SET [‘ + name + ‘] = NULL WHERE [‘ + name + ‘] = ””;’ FROM syscolumns WHERE id = object_id(‘table’) AND isnullable = 1;
-
Remove Empty Directories using c#
private static void DeleteEmptyDirectory(string startLocation) { foreach (var directory in Directory.GetDirectories(startLocation)) { DeleteEmptyDirectory(directory); if (Directory.GetFiles(directory).Length == 0 && Directory.GetDirectories(directory).Length == 0) { Directory.Delete(directory, false); } } }