Skip to content

Instantly share code, notes, and snippets.

@FilipDeVos
FilipDeVos / .gitignore
Created December 1, 2009 18:04 — forked from tobinharris/.gitignore
Standard .gitignore file & transform script for svn global-ignores
# .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
@FilipDeVos
FilipDeVos / _gvimrc
Created December 17, 2009 11:19
vim config files
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 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
@FilipDeVos
FilipDeVos / install-hooks.bat
Created February 5, 2010 14:16
Subversion Hooks
@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
)
@FilipDeVos
FilipDeVos / numeric_padding.sql
Created May 12, 2011 14:36
Pad a number with TSQL
DECLARE @mynumber INT
, @padding INT
SELECT @mynumber = 123
, @padding = 8
SELECT REPLACE(STR(@mynumber, @padding), ' ', '0')
@FilipDeVos
FilipDeVos / xp_msver.sql
Created May 12, 2011 14:42
Determine SQL Version
exec xp_msver 'ProductVersion'
@FilipDeVos
FilipDeVos / @@version.sql
Created May 12, 2011 14:51
Determine SQL Version 2
select @@version
@FilipDeVos
FilipDeVos / serverproperty.sql
Created May 12, 2011 14:51
Determine SQL Version 3
select serverproperty('productversion')
@FilipDeVos
FilipDeVos / @@microsoftversion.sql
Created May 12, 2011 14:53
Determine SQL Version 4
select @@microsoftversion / 0x01000000
@FilipDeVos
FilipDeVos / @@microsoftversion_query.sql
Created May 12, 2011 14:58
Determine SQL Version 5
SELECT CASE @@microsoftversion/ 0x01000000
WHEN 8 THEN 'sql 2000'
WHEN 9 THEN 'sql 2005'
WHEN 10 THEN 'sql 2008'
WHEN 11 THEN 'sql Denali'
END
@FilipDeVos
FilipDeVos / identity_insert_01.sql
Created May 13, 2011 07:35
Enabled Identity insert for normal users
create database identity_insert_test
GO
use identity_insert_test
exec sp_addlogin 'SimpleLogin', 'PasswordForSimpleLogin'
GO
exec sp_grantdbaccess 'SimpleLogin', 'SimpleLogin'
GO
if object_id('dbo.a') is not null
drop table dbo.a