How to move windows between monitors with Windows 7

I had this problem for some time. I use multiple monitors and my video settings are set always like that, even when I do not really need all monitors and use only the primary one. It is very often to lose a window of an application on another monitor seeing its icon on the taskbar of my primary screen. Restore, cascade, show stacked commands are just useless in this case as they only rearrange the windows of the main monitor. But there is a way to fix that by a few key shortcuts.

Win+Shift+Left - moves window to the left monitor
Win+Shift+Right - moves window to the right monitor
and maybe Up and Down to move to the upper or lower monitor - I do not have monitors above and below so I couldnt test these.

Win+Left - adheres the window to the left half of the screen. Continuous clicking causes moving the window to another monitor.
Win+Right - adheres the window on the right half of the screen. Continuous clicking causes moving the window to another monitor.
Win+Up - maximizes the window
Win+Down - Minimizes and restores if maximized



How to find the largest sql objects in an SQL Server database

Sometimes you may need know how big some tables are, how many rows they have and how much disk space they use.

The following query looks for the biggest tables in size (MB) and number of rows:

SELECT * FROM (
SELECT 
    tbl.NAME AS TableName,
    ind.name as indexName,
    sum(p.rows) as RowCounts,
    (sum(a.total_pages) * 8) / 1024 as TotalSpaceMB, 
    (sum(a.used_pages) * 8) / 1024 as UsedSpaceMB, 
    (sum(a.data_pages) * 8) / 1024 as DataSpaceMB
FROM 
    sys.tables tbl INNER JOIN 
    sys.indexes ind ON tbl.OBJECT_ID = ind.object_id INNER JOIN 
    sys.partitions p ON ind.object_id = p.OBJECT_ID AND ind.index_id = p.index_id INNER JOIN 
    sys.allocation_units a ON p.partition_id = a.container_id
WHERE 
    tbl.NAME NOT LIKE 'dt%' AND
    ind.OBJECT_ID > 255 AND   
    ind.index_id <= 1
GROUP BY     tbl.NAME, ind.object_id, ind.index_id, ind.name 
) as t1  ORDER BY TotalSpaceMB desc ,UsedSpaceMB desc

How to replace a character in Excel with a new line

Here is the trick:

1. Select the character or string you would like to replace
2. Copy (Ctrl+C)
3. Open Find Dialog (Ctrl+F) and open Replace Tab
4. Paste the string to be repalced in the firts textbox (Ctrl+V)
5. Enter in the second textbox Alt+010 which represents a new line with its ASCII equivalent.
6. Click replace and enjoy.