Skip to content

Instantly share code, notes, and snippets.

View Solstice1557's full-sized avatar

Salavat Gainetdinov Solstice1557

  • Front
  • Ufa, Russia
View GitHub Profile
angular.module('app', []).directive('ngDebounce', function($timeout) {
return {
restrict: 'A',
require: 'ngModel',
priority: 99,
link: function(scope, elm, attr, ngModelCtrl) {
if (attr.type === 'radio' || attr.type === 'checkbox') return;
elm.unbind('input');
@Solstice1557
Solstice1557 / gist:cd151fdf4446f8495ce9
Created May 20, 2014 05:58
Drop column with constraints
DECLARE @sql NVARCHAR(MAX)
WHILE 1=1
BEGIN
SELECT TOP 1 @sql = N'alter table TABLE_NAME drop constraint ['+dc.NAME+N']'
from sys.default_constraints dc
JOIN sys.columns c
ON c.default_object_id = dc.object_id
WHERE
dc.parent_object_id = OBJECT_ID('TABLE_NAME')
AND c.name = N'COLUMN_NAME'