Both IIF and CASE expressions are used to make some decision based on an expression and return one of the two values. While CASE expression is supported in all versions, IIF is supported from version 2012 onwards. Here is the performance comparison of these two. Continue reading →
ORM (Object Relational Mapping) is basically an approach for storing data from domain/entity objects to relational database in an automated way without writing much code. A true ORM is independent of what database server we refer to, the code underlying ORM’s is database independent and can run with any database server having similar database with a structure needed by the application. ORM has 3 main parts: Entity class objects, Relational DB objects and information on how domain objects maps to relational DB objects, i.e., tables, views and storedprocedures.Continue reading →
Deferred/Lazy execution: This type of a statement is executed only when the output is a necessity to proceed further in the program; until then, the execution can wait! This is the standard way in which most Language Integrated Queries (LINQ) are executed.
Deferred Execution is extremely helpful in scenarios where you don’t need the entire output to be computed at a point of time. This is made possible through the use of interation over an IEnumerable having a yield functionality.Continue reading →
A – While this exactly isn’t a question; however, answering this in the wrong way can hurt your chances greatly of getting any job. This actually can be a tricky question. Hiring managers cannot ask certain questions legally; however, if you go away on a tangent while answering, you might tell them a few things about you which are better left unstated.” The worst means to approach this is to tell about your life story to them, which is something which they definitely aren’t interested in. The most excellent method to approach this request is to just discuss what all your interests are related to that job and how your background actually makes you the right candidate. Continue reading →
Cursor is SQL data-type, this is used for saving a select result in order to seek through rows.
Cursor is a really useful guy, specially when you want to fetch records one-by-one, generally most of the database systems support cursor because it has defined in SQL ISO. Continue reading →
Both exec() and sp_executesql are used for running dynamic SQL commands, just need to prepare the commands as a String object and call the sp_executesql.
Both of exec() and sp_executesql are same, exec() is the new face of sp_executesql has added in SQL Server V9.
declare @com nvarchar(1024);
set @com='create table MyTable'+convert(varchar(3),@i)+'(id int,[name] varchar(64));';
exec sp_executesql @com;
--exec(@com);--as same as above, the new face