Archive for February 24, 2010

Query to find the list of Triggers in the database categorized with Trigger Type SELECT S2.[name] TableName, S1.[name] TriggerName, CASE WHEN S1.deltrig > 0 THEN ‘Delete’ WHEN S1.instrig > 0 THEN ‘Insert’ WHEN S1.updtrig > 0 THEN ‘Update’ END ‘TriggerType’ FROM sysobjects S1 JOIN sysobjects S2 ON S1.parent_obj = S2.[id] WHERE S1.xtype=’TR’

Following code can be used to validate a credit card number and to get the card brand by card number: /// /// Enum for card type. /// public enum CardType { MasterCard = 1, BankCard = 2, Visa = 3, AmericanExpress = 4, Discover = 5, DinersClub = 6, JCB = 7, unKnown = 8 [...]