Temporarily enable/disable trigger (SQL Server)
ALTER TABLE tablename DISABLE TRIGGER ALL -- do work here ALTER TABLE tablename ENABLE TRIGGER ALL
12388 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
ALTER TABLE tablename DISABLE TRIGGER ALL -- do work here ALTER TABLE tablename ENABLE TRIGGER ALL
calendar.renderEvent.subscribe(YAHOO.your_app.calendar().initArrows, calendar);
YAHOO.your_app.calendar = function() { var addDays = function(date, days) { return YAHOO.widget.DateMath.add(date, YAHOO.widget.DateMath.DAY, days); }; var showPreviousArrow = function(cal) { return showArrow(cal, cal.toDate(cal.cellDates[0]), 1); }; var showNextArrow = function(cal) { return showArrow(cal, cal.toDate(cal.cellDates[cal.cellDates.length-1]), -1); }; var showArrow = function(cal, startingDate, step) { if (!cal.isDateOOM(startingDate)) { //ie not overlapping return !cal.isDateOOB(addDays(startingDate, (-1 * step))); } for (var i=0; (i * step) < 7; i += step) { //iterate forwards for previous month check, backwards for next month check var date = addDays(startingDate, i); if (!cal.isDateOOM(date)) { //shortcut exit; as soon as we find an in month date we can supress the arrow return false; } else if (!cal.isDateOOB(date)) { return true; } } return false; }; return { initArrows: function(type, args, cal) { if (!showPreviousArrow(cal)) { hideArrow(cal, cal.Style.CSS_NAV_LEFT); } if (!showNextArrow(cal)) { hideArrow(cal, cal.Style.CSS_NAV_RIGHT); } } }; };