git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Linq.Expressions; | |
using System.Text; | |
using System.Web.Mvc; | |
using System.Web.Mvc.Html; | |
namespace TSolution.DataManagement.Infrastructure.Presentation.Mvc.Helpers | |
{ |
appcmd.exe list site /xml | appcmd delete site /in |
--Get Top 100 executed SP's ordered by execution count | |
SELECT TOP 100 qt.text AS 'SP Name', qs.execution_count AS 'Execution Count', | |
qs.execution_count/DATEDIFF(Second, qs.creation_time, GetDate()) AS 'Calls/Second', | |
qs.total_worker_time/qs.execution_count AS 'AvgWorkerTime', | |
qs.total_worker_time AS 'TotalWorkerTime', | |
qs.total_elapsed_time/qs.execution_count AS 'AvgElapsedTime', | |
qs.max_logical_reads, qs.max_logical_writes, qs.total_physical_reads, | |
DATEDIFF(Minute, qs.creation_time, GetDate()) AS 'Age in Cache' | |
FROM sys.dm_exec_query_stats AS qs | |
CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) AS qt |
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED ; | |
WITH XMLNAMESPACES (DEFAULT 'http://schemas.microsoft.com/sqlserver/2004/07/showplan'), | |
core AS ( | |
SELECT | |
eqp.query_plan AS [QueryPlan], | |
ecp.plan_handle [PlanHandle], | |
q.[Text] AS [Statement], | |
n.value('(@StatementOptmLevel)[1]', 'VARCHAR(25)') AS OptimizationLevel , | |
ISNULL(CAST(n.value('(@StatementSubTreeCost)[1]', 'VARCHAR(128)') as float),0) AS SubTreeCost , |
select * | |
from sys.dm_db_session_space_usage spu | |
join sys.dm_exec_sessions s on s.session_id = spu.session_id | |
join sys.dm_exec_requests r on s.session_id = r.session_id | |
cross apply sys.dm_exec_sql_text(sql_handle) t | |
order by internal_objects_alloc_page_count desc |
public class ReadonlyDbContext : MyDbContext | |
{ | |
static ReadonlyDbContext() | |
{ | |
Database.SetInitializer<ReadonlyDbContext>(null); | |
} | |
public ReadonlyDbContext() | |
{ | |
SetConfigurationOptions(); |
// DON'T add the key if auto-generated | |
ctx.BulkInsert(customers, operation => operation.ColumnInputExpression = | |
customer => new {customer.Name, customer.Email}); | |
// ALWAYS add the key | |
ctx.BulkUpdate(customers, operation => operation.ColumnInputExpression = | |
customer => new { customer.ID, customer.Name, customer.Email }); | |
// ALWAYS add the key | |
ctx.BulkMerge(customers, operation => operation.ColumnInputExpression = |
// Single Key | |
ctx.BulkUpdate(customers, operation => operation.ColumnPrimaryKeyExpression = | |
customer => customer.Code); | |
// Surrogate Key (with anonymous type) | |
ctx.BulkUpdate(customers, operation => operation.ColumnPrimaryKeyExpression = | |
customer => new { customer.Code1, customer.Code2, customer.Code3 }); |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" | |
"http://www.w3.org/TR/html4/strict.dtd"> | |
<html lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<title>untitled</title> | |
<meta name="generator" content="TextMate http://macromates.com/"> | |
<meta name="author" content="David Mosher"> | |
<!-- Date: 2010-11-18 --> |