Functions and Stored Procedures have few similarities such as: They are group of T-SQL statements which is stored on the server.These group of T-SQL statements are executed as a unit. Abstracts the developer from the implementation details since he needs to just call the procedure or function. Accepts parameters and return values. Are used to create […]
Archives for September 2015
Error Handling in SQL Server
Exception is a runtime error which prevents the normal execution of code.There are different ways of error handling in SQL Server. Each error in SQL Server has certain information attached to it.Some of the important information attached to each error is: Message Number Each error has a error number. Severity Number […]
DML Triggers in SQL Server
A Trigger in SQL Server is a database object.SQL Server contains many different objects which either store data or provide access to the data.Other common database objects are: Table View Stored Procedures Function Index Constraint Trigger has a similarity with a stored procedure.Both Stored Procedure and Trigger contains T-SQL statements which are executed as a […]
Sorting List of Custom type in C#
Sorting items in a collection is a common requirement specially when the collection contains lots of items.If our collection contains primitive type only then we can easily sort the items in the collection by just calling the sort method. So if declare a collection of integers as List<int> lst = new List<int>{34,3,544,5,743,14,5425}; Then we just […]
Use and example of Proxy Design Pattern
Name Proxy Type Structural Design Pattern Description An object acts as a placeholder for another object.Client interacts with Proxy(placeholder) rather then actual object. In the Proxy Design pattern an object called the Proxy is used as a placeholder for another object.The main object provides the actual functionality whereas the proxy object is […]