I love how top can accept a variable. You could pass it into a procedure.
DECLARE @vcOut VARCHAR(MAX), @nTop INT SELECT @nTop = 5 SELECT TOP (@nTop) @vcOut = COALESCE(@vcOut, '') + NAME + CHAR(10) FROM sys.sysdatabases PRINT @vcOut --
I love how top can accept a variable. You could pass it into a procedure.
DECLARE @vcOut VARCHAR(MAX), @nTop INT SELECT @nTop = 5 SELECT TOP (@nTop) @vcOut = COALESCE(@vcOut, '') + NAME + CHAR(10) FROM sys.sysdatabases PRINT @vcOut --
There is an issue with Mouse shadow in Remote Desktop. Can you follow the below steps on your Windows 2012 server.
1. Right click the start menu and choose Control panel
2. Change the View by from Category to Small icons
3. Click Mouse then Pointers tab
4. Uncheck “Enable Pointer Shadow”
(Thanks, Bobby!)
Last SPIDs, their statement, network packet size.
SELECT c.session_id, s.host_name, s.login_name, [LastStatement].[[text]], c.net_packet_size, s.login_time, s.status, d.name FROM sys.dm_exec_connections c INNER JOIN sys.dm_exec_sessions s ON c.session_id = s.session_id CROSS APPLY sys.dm_exec_sql_text(most_recent_sql_handle) AS LastStatement LEFT OUTER JOIN sys.databases d on d.database_id = [LastStatement].dbid ORDER BY s.[status], s.login_time DESC, s.[host_name] --