Thursday, April 18, 2013

is string IEnumerable?


Do you know that string is IEnumerable and it’s a collection of character?
You don’t believe then try a simple code
***************************************************
  string z = "abc";
if (z is IEnumerable)
{
}
 ***************************************************
Or much simpler -> a go to definition for string
 
    public sealed class String : IComparable, ICloneable, IConvertible, IComparableIEnumerableIEnumerable, IEquatable
 

Friday, April 5, 2013

Drop and Create Script Issue with SQL Server 2012

When you do drop and create SP in SQL Server 2008, the script will have “If exists” script. But in SQL Server 2012 this check is missing it just does a drop and create. So if the script is getting executed the first time, it may throw an error since the SP is not present and we are trying to Drop a  non-existen

Thursday, April 4, 2013

View Dependency does not work with Views

If say few SPs uses a view, if you right click on a view and say View Dependecy, it will not show the SPs using the view.

Compile time validation in Stored Procedure


A Stored Procedure will validate a table schema only if its present. If say a table exists and we mention an invalid column name the SP will throw error when we compile it.
But if the table itself is not present then the SP will not throw error during compilation but will throw error only during run time!