Working With DIR Command

I worked with tons of files and I needed to sort them into an Excel file. It was almost impossible to do it manually and would take hours or even days to complete. So basically, this what I did: I collected them into a single folder let’s say Foldera. The full path is in D:\Foldera. It […]

Show Table Size on SQL Server

This is the query on SQL Server (I use SQL Server 2008) how to show all table size on database schema. SELECT t.NAME AS TableName, s.Name AS SchemaName, p.rows AS RowCounts, SUM(a.total_pages) * 8 AS TotalSpaceKB, SUM(a.used_pages) * 8 AS UsedSpaceKB, (SUM(a.total_pages) – SUM(a.used_pages)) * 8 AS UnusedSpaceKB FROM sys.tables t INNER JOIN sys.indexes i […]

Split Log File and Copy Large File(s)

As a reminder for myself, here is the useful syntax on Linux that I recently use: split -l 2000 logfile.txt scp home_location username@destinationip:destination_location The first syntax is used when we get error logged on a text file but it’s too large to be opened with standard text editor. We can split the files into certain lines, for […]