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
using System; | |
using System.Text; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.IO; | |
namespace TheBestAppEver | |
{ | |
/// <summary> | |
/// The type of <see cref="ListDiffAction{S,D}"/>. |
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
Performance of scalar functions is usually not very good, to do what you ask I would write it as a table valued function. A table valued function has the benefit that it is inlined properly. | |
Other forms of the query will not make a huge difference as it is the calls to the function which eat up the time. | |
CREATE FUNCTION dbo.fn_age(@birthdate datetime, @current_date datetime) | |
RETURNS TABLE | |
WITH SCHEMABINDING | |
AS | |
return ( | |
SELECT cast((DATEPART(year, @current_date - @birthdate)) - 1900 as varchar(4)) + 'y ' |
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
SET NOCOUNT ON | |
DECLARE @cert_name sysname = 'MyLovelyCertificate' | |
, @assembly_name nvarchar(4000) = 'MyAssembly' | |
, @assembly_path nvarchar(256) = 'c:\MyAssembly.dll' | |
, @safe_cert_name sysname | |
, @cert_path nvarchar(256) | |
, @login_name sysname | |
, @sid varbinary(85) | |
, @msg nvarchar(max) |
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
IF EXISTS(SELECT * FROM sys.schemas WHERE name ='xml_raw_schema') | |
DROP XML SCHEMA COLLECTION dbo.xml_raw_schema | |
GO | |
CREATE XML SCHEMA COLLECTION xml_raw_schema AS | |
N'<?xml version="1.0"?> | |
<xsd:schema xmlns:targetNamespace="http://schemas.mycompany.com/myproduct" | |
elementFormDefault="qualified" | |
attributeFormDefault="unqualified" | |
xmlns:xsd="http://www.w3.org/2001/XMLSchema" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> |
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
CREATE FUNCTION dbo.fn_strip_zeros(@number numeric(38,10)) | |
RETURNS varchar(38) | |
WITH ENCRYPTION | |
AS | |
BEGIN | |
DECLARE @result varchar(38) | |
DECLARE @decimal varchar(3) | |
SET @decimal = substring(convert(varchar(38), convert(numeric(38,10),1)/5 ), 2,1) |
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
@echo off | |
FOR /D %%I in (*) DO ( | |
echo Installing hooks in %%I | |
copy pre-revprop-change.bat %%I\hooks\ /Y | |
copy pre-commit.bat %%I\hooks\ /Y | |
) |
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
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
" options for gvim on Windows 7 | |
" | |
" Author: Filip De Vos | |
" Last updated: 1st April 2010 | |
" | |
" To use this conveniently I work like this: | |
" - check out the gist in my Git working folder with: | |
" cd ~/Documents/WorkingGit/ | |
" git clone git://gist.github.com/258688.git vimconfig |
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
# .gitignore for .NET projects | |
# Thanks to Derick Bailey | |
# http://www.lostechies.com/blogs/derickbailey/archive/2009/05/18/a-net-c-developer-s-gitignore-file.aspx | |
# Additional Thanks to | |
# - Alexey Abramov | |
# Standard VS.NET and ReSharper Foo | |
obj | |
bin | |
*.csproj.user |