Skip to content

Instantly share code, notes, and snippets.

@derjabkin
derjabkin / Proc_BackupDatabaseDailyWithLog.sql
Created November 9, 2013 19:01
Daily database and hourly log backup on Microsoft SQL Sever
if not OBJECT_ID('dbo.Proc_BackupDatabaseDailyWithLog') is null
Drop Proc dbo.Proc_BackupDatabaseDailyWithLog
go
Create Proc dbo.Proc_BackupDatabaseDailyWithLog(
@DbName sysname,
@TargetPath nvarchar(1000)) as
@derjabkin
derjabkin / Proc_BackupDatabaseDailyWithLog.sql
Created November 11, 2013 07:16
Daily backup of full logged databases with log backup.
if not OBJECT_ID('dbo.Proc_BackupDatabaseDailyWithLog') is null
Drop Proc dbo.Proc_BackupDatabaseDailyWithLog
go
Create Proc dbo.Proc_BackupDatabaseDailyWithLog(
@DbName sysname,
@TargetPath nvarchar(1000)) as
@derjabkin
derjabkin / gist:11145781
Created April 21, 2014 15:22
Build eXpand with Self-Compiled DX-Assemblies
msbuild xpand.build /t:Copy;NuGetPackage /p:Version=13.2.9.100;SkipFixReferences=true;SkipDashboard=true
public static TItem MaxBy<TItem, TValue>(this IEnumerable<TItem> items, Func<TItem, TValue> selector)
where TValue : IComparable
{
if (items == null)
throw new ArgumentNullException("items");
if (selector == null)
throw new ArgumentNullException("selector");
TItem maxItem = items.FirstOrDefault();