This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select o1.name table_name,o1.object_id,si.name index_name,dm.reserved_page_count * 8.0/1024 mbsize | |
from sys.objects o1 | |
join sys.dm_db_partition_stats dm on dm.object_id=o1.object_id | |
join sys.indexes si on si.object_id=o1.object_id and dm.index_id=si.index_id | |
where o1.object_id>255 | |
order by mbsize desc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT TOP 25 | |
q.[text], | |
(total_logical_reads/execution_count) AS avg_logical_reads, | |
(total_logical_writes/execution_count) AS avg_logical_writes, | |
(total_physical_reads/execution_count) AS avg_phys_reads, | |
total_physical_reads, | |
creation_time, | |
last_execution_time, | |
Execution_count, | |
execution_count/ datediff(mi,creation_time,getdate()) as avg_execs_per_minute |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @DatabaseName SYSNAME = DB_NAME(), @TableName VARCHAR(256) | |
DECLARE @DynamicSQL NVARCHAR(max) = | |
'DECLARE curAllTablesInDB CURSOR FOR SELECT TABLE_SCHEMA + | |
''.'' + TABLE_NAME AS TABLENAME | |
FROM ' + @DatabaseName + '.INFORMATION_SCHEMA.TABLES WHERE | |
TABLE_TYPE = ''BASE TABLE''' | |
BEGIN | |
EXEC sp_executeSQL @DynamicSQL -- create tables cursor | |
OPEN curAllTablesInDB | |
FETCH NEXT FROM curAllTablesInDB INTO @TableName |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sELECT CONVERT (varchar, getdate(), 126) AS runtime, | |
mig.index_group_handle, | |
mid.index_handle, | |
CONVERT (decimal (28,1), | |
migs.avg_total_user_cost * | |
migs.avg_user_impact * | |
(migs.user_seeks + migs.user_scans)) | |
AS improvement_measure, | |
'CREATE INDEX missing_index_' + | |
CONVERT (varchar, mig.index_group_handle) + |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
CASE DTL.REQUEST_SESSION_ID | |
WHEN -2 THEN 'ORPHANED DISTRIBUTED TRANSACTION' | |
WHEN -3 THEN 'DEFERRED RECOVERY TRANSACTION' | |
ELSE DTL.REQUEST_SESSION_ID END AS SPID, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
o list all available commands enter "/?". | |
João Duarte joined group chat. | |
João Duarte left group chat. | |
João Duarte joined group chat. | |
João Duarte 11:18 AM | |
hey | |
João Duarte left group chat. | |
me 11:18 AM |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Customer { | |
public ICollection<Order> Orders{get;set;} | |
// business logic and other properties omitted | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
logparser "select cs-username, c-ip,date,time,cs-uri-stem,cs-uri-query,time-taken into rapp_logs from <logfile>" -o:SQL -server:<dbserver> -createtable:on -database:<database> -I:W3C |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#http://www.journaldev.com/2856/java-jvm-memory-model-and-garbage-collection-monitoring-tuning | |
jstat -gc 27037 | tail -1 | awk '{ print $3 + $4 + $6 + $8}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void Execute() { | |
var employee = PayrollDatabase.Instance.GetEmployee(_empId); | |
if(employee!=null) { | |
Change(employee); | |
} | |
} |
OlderNewer