<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.dotnetzone.gr:443/cs/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="el"><title type="html">Dot Net Rules</title><subtitle type="html">Yes, to dance beneath the diamond sky with one hand waving free</subtitle><id>https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/atom.aspx</id><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/default.aspx" /><link rel="self" type="application/atom+xml" href="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/atom.aspx" /><generator uri="http://communityserver.org" version="2.1.20423.1">Community Server</generator><updated>2013-12-04T19:11:00Z</updated><entry><title>Display Data using a Stored Procedure in an ASP.Net MVC 5.0 application with Entity Framework 6.0</title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2017/03/12/display-data-using-a-stored-procedure-in-an-asp-net-mvc-5-0-application-with-entity-framework-6-0.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2017/03/12/display-data-using-a-stored-procedure-in-an-asp-net-mvc-5-0-application-with-entity-framework-6-0.aspx</id><published>2017-03-13T04:04:00Z</published><updated>2017-03-13T04:04:00Z</updated><content type="html">In this post I will be looking into EF 6.0 using the Code First Workflow and its support for stored procedures and more particularly how to display data using a stored procedure. I have posted something similar in this post https://weblogs.asp.net/dotnetstories/using-stored-procedures-in-an-asp-net-mvc-5-0-application-using-entity-framework-6-0 but this post described in detail how to insert, update and delete data in an ASP.Net MVC 6.0 application using stored procedures but not how to display data...(&lt;a href="https://www.dotnetzone.gr:443https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2017/03/12/display-data-using-a-stored-procedure-in-an-asp-net-mvc-5-0-application-with-entity-framework-6-0.aspx"&gt;read more&lt;/a&gt;)&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=78030" width="1" height="1"&gt;</content><author><name>nikolaosk</name><uri>https://www.dotnetzone.gr:443/cs/members/nikolaosk.aspx</uri></author><category term="stored procedures" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/stored+procedures/default.aspx" /><category term="asp.net" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/asp.net/default.aspx" /><category term="Entity framework" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/Entity+framework/default.aspx" /><category term="Entity Framework 6.0" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/Entity+Framework+6.0/default.aspx" /><category term="asp.net mvc 5.0" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/asp.net+mvc+5.0/default.aspx" /></entry><entry><title>Understanding Dependency Injection in ASP.Net MVC applications</title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2016/12/27/understanding-dependency-injection-in-asp-net-mvc-applications.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2016/12/27/understanding-dependency-injection-in-asp-net-mvc-applications.aspx</id><published>2016-12-28T02:14:00Z</published><updated>2016-12-28T02:14:00Z</updated><content type="html">In this post I am going to discuss Dependency Injection pattern, explain why we need it and how to use it in our modern web applications based on ASP.Net MVC paradigm. DI ( Dependency Injection ) is not a difficult concept to grasp but a lot of developers do not understand it or even worse they use it wrongly. We use DI to decouple layers in our application. I assume that you use Layered Architecture principles and patterns when architecting your application. Usually we want to decouple the Domain's...(&lt;a href="https://www.dotnetzone.gr:443https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2016/12/27/understanding-dependency-injection-in-asp-net-mvc-applications.aspx"&gt;read more&lt;/a&gt;)&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=77895" width="1" height="1"&gt;</content><author><name>nikolaosk</name><uri>https://www.dotnetzone.gr:443/cs/members/nikolaosk.aspx</uri></author><category term="ASP.NET MVC" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/ASP.NET+MVC/default.aspx" /><category term="Design Patterns" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/Design+Patterns/default.aspx" /><category term="Inversion of Control" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/Inversion+of+Control/default.aspx" /><category term="Dependency Injection" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/Dependency+Injection/default.aspx" /></entry><entry><title>Returning IQueryable from Repository Pattern</title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2016/10/15/returning-iqueryable-from-repository-pattern.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2016/10/15/returning-iqueryable-from-repository-pattern.aspx</id><published>2016-10-16T06:16:00Z</published><updated>2016-10-16T06:16:00Z</updated><content type="html">In this post I am going to make the case why returning IQueryable from a Repository Pattern is an anti-pattern and why you should not do it. I assume that you have some experience on building applications using the Layered Architecture and are familiar with various design patterns like Unit of Work and Repository pattern. You can have a look at this post if you want to find out more about the Repository Pattern. In this post I am talking the Repository pattern and Entity Framework and explain why...(&lt;a href="https://www.dotnetzone.gr:443https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2016/10/15/returning-iqueryable-from-repository-pattern.aspx"&gt;read more&lt;/a&gt;)&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=77852" width="1" height="1"&gt;</content><author><name>nikolaosk</name><uri>https://www.dotnetzone.gr:443/cs/members/nikolaosk.aspx</uri></author><category term="Repository Pattern" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/Repository+Pattern/default.aspx" /><category term="IQueryable" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/IQueryable/default.aspx" /></entry><entry><title>Entity Framework and Repository Pattern</title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2016/07/31/entity-framework-and-repository-pattern.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2016/07/31/entity-framework-and-repository-pattern.aspx</id><published>2016-08-01T05:32:26Z</published><updated>2016-08-01T05:32:26Z</updated><content type="html">In this post I will try to explain why the Repository Pattern is not redundant when we use an ORM like Entity Framework in our application. There are many blog posts and many questions/answers in places like StackOverflow where developers argue about that issue. I will not be writing code in this article but I will try to explain why Entiti Framework does not implement the Repository Pattern and what is the difference between them are. Before reading this post by all means do have a look at this...(&lt;a href="https://www.dotnetzone.gr:443https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2016/07/31/entity-framework-and-repository-pattern.aspx"&gt;read more&lt;/a&gt;)&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=77766" width="1" height="1"&gt;</content><author><name>nikolaosk</name><uri>https://www.dotnetzone.gr:443/cs/members/nikolaosk.aspx</uri></author><category term="Entity framework" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/Entity+framework/default.aspx" /><category term="Repository Pattern" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/Repository+Pattern/default.aspx" /></entry><entry><title>Explaining the Repository Pattern</title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2016/07/31/explaining-the-repository-pattern.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2016/07/31/explaining-the-repository-pattern.aspx</id><published>2016-07-31T08:47:00Z</published><updated>2016-07-31T08:47:00Z</updated><content type="html">In this post I will try to define the Repository Pattern, explain what it is and how we must use it in my ow words and according to my experience as a software engineer. I will not be writing much code in this post but I will highlight the reasons why we need the Repository Pattern and what it helps us achieve. Let me start with the official definition. Martin Fowle in his book Patterns of Enterprise Application Architecture (a must for every software engineer) gives the definition of the Repository...(&lt;a href="https://www.dotnetzone.gr:443https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2016/07/31/explaining-the-repository-pattern.aspx"&gt;read more&lt;/a&gt;)&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=77765" width="1" height="1"&gt;</content><author><name>nikolaosk</name><uri>https://www.dotnetzone.gr:443/cs/members/nikolaosk.aspx</uri></author><category term="C#" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/C_2300_/default.aspx" /><category term="Repository Pattern" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/Repository+Pattern/default.aspx" /></entry><entry><title>Using ViewModels in ASP.Net MVC 5.0 applications </title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2016/06/18/using-viewmodels-in-asp-net-mvc-5-0-applications.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2016/06/18/using-viewmodels-in-asp-net-mvc-5-0-applications.aspx</id><published>2016-06-19T02:54:00Z</published><updated>2016-06-19T02:54:00Z</updated><content type="html">In this post I am going to create a hands on example, a sample ASP.Net MVC application where I will demonstrate the concept of ViewModels. As we know MVC is a UI design pattern. MVC is based on an architecture model that embraces the so called "seperation of concern pattern". There are three main building blocks in the MVC pattern. The Controller orchestrates everything.When we have an HTTP request coming in, that request is routed to the Controller. The View talks to the Model. The Model has the...(&lt;a href="https://www.dotnetzone.gr:443https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2016/06/18/using-viewmodels-in-asp-net-mvc-5-0-applications.aspx"&gt;read more&lt;/a&gt;)&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=77743" width="1" height="1"&gt;</content><author><name>nikolaosk</name><uri>https://www.dotnetzone.gr:443/cs/members/nikolaosk.aspx</uri></author><category term="Entity framework" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/Entity+framework/default.aspx" /><category term="ASP.NET MVC" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/ASP.NET+MVC/default.aspx" /><category term="asp.net mvc 5.0" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/asp.net+mvc+5.0/default.aspx" /><category term="ViewModels" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/ViewModels/default.aspx" /></entry><entry><title>Using Jquery Ajax method in ASP.Net MVC</title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2016/06/12/using-jquery-ajax-method-in-asp-net-mvc.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2016/06/12/using-jquery-ajax-method-in-asp-net-mvc.aspx</id><published>2016-06-13T03:33:00Z</published><updated>2016-06-13T03:33:00Z</updated><content type="html">In this post I will use a simple ASP.Net 5.0 MVC application to implement a jQuery Ajax call to an ASP.Net MVC controller. JQuery is not only about DOM manipulation and handling events on the client. It is very powerful when we want to manipulate HTML elements but also can talk with server side and instantiate In this example we will use the JQuery Ajax function to talk to an ASP.Net MVC controller and result JSONResult to the view. You can have a look in this post of mine where I talk about JQuery...(&lt;a href="https://www.dotnetzone.gr:443https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2016/06/12/using-jquery-ajax-method-in-asp-net-mvc.aspx"&gt;read more&lt;/a&gt;)&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=77737" width="1" height="1"&gt;</content><author><name>nikolaosk</name><uri>https://www.dotnetzone.gr:443/cs/members/nikolaosk.aspx</uri></author></entry><entry><title>Looking into the Generic Repository Pattern, Entity Framework and ASP.Net MVC</title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2016/05/15/looking-into-the-generic-repository-pattern-entity-framework-and-asp-net-mvc.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2016/05/15/looking-into-the-generic-repository-pattern-entity-framework-and-asp-net-mvc.aspx</id><published>2016-05-16T03:19:00Z</published><updated>2016-05-16T03:19:00Z</updated><content type="html">When developing/architecting our custom ASP.Net MVC applications we do use the Repository Pattern/Generic Repository Pattern . I want to share my experience and thoughts with the community of developers out there that use Generic Repositories in their code. At first a definition is appropriate. Martin Fowler gives the definition of the Repository Pattern: "Mediates between the domain and data mapping layers using a collection-like interface for accessing domain objects.". You can read more link in...(&lt;a href="https://www.dotnetzone.gr:443https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2016/05/15/looking-into-the-generic-repository-pattern-entity-framework-and-asp-net-mvc.aspx"&gt;read more&lt;/a&gt;)&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=77708" width="1" height="1"&gt;</content><author><name>nikolaosk</name><uri>https://www.dotnetzone.gr:443/cs/members/nikolaosk.aspx</uri></author><category term="Entity framework" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/Entity+framework/default.aspx" /><category term="Design Patterns" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/Design+Patterns/default.aspx" /><category term="Repository Pattern" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/Repository+Pattern/default.aspx" /><category term="Generic Repositories" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/Generic+Repositories/default.aspx" /></entry><entry><title>Building a simple ASP.NET MVC 6 application using Entity Framework 7 &amp; ASP.NET 5 RC</title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2016/03/27/building-a-simple-asp-net-mvc-6-application-using-entity-framework-7-amp-asp-net-5-rc.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2016/03/27/building-a-simple-asp-net-mvc-6-application-using-entity-framework-7-amp-asp-net-5-rc.aspx</id><published>2016-03-28T04:41:00Z</published><updated>2016-03-28T04:41:00Z</updated><content type="html">In this post I will article shows you how to build a simple web application in ASP.NET MVC 6 &amp;amp; Entity Framework 7 using ASP.NET 5-ASP.Net Core. I will also demonstrate some new concepts in ASP.Net 5.0 and highlight important changes. If you are new to ASP.Net 5.0 and MVC 6.0 then please have a look at this introductory post of mine, here . If you want to learn ASP.Ne 5.0 by video there is a great introductory course by Scott Hanselman in this link . You can developer ASP.Net 5.0 applications...(&lt;a href="https://www.dotnetzone.gr:443https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2016/03/27/building-a-simple-asp-net-mvc-6-application-using-entity-framework-7-amp-asp-net-5-rc.aspx"&gt;read more&lt;/a&gt;)&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=77639" width="1" height="1"&gt;</content><author><name>nikolaosk</name><uri>https://www.dotnetzone.gr:443/cs/members/nikolaosk.aspx</uri></author><category term="ASP.Net MVC 6.0" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/ASP.Net+MVC+6.0/default.aspx" /><category term="ASP.Net 5.0" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/ASP.Net+5.0/default.aspx" /><category term="visual studio 2015" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/visual+studio+2015/default.aspx" /><category term="Entity Framework 7.0" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/Entity+Framework+7.0/default.aspx" /></entry><entry><title>Passing multiple models to a view using Tuples in an ASP.Net MVC 5.0 application</title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2016/03/06/passing-multiple-models-to-a-view-using-tuples-in-an-asp-net-mvc-5-0-application.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2016/03/06/passing-multiple-models-to-a-view-using-tuples-in-an-asp-net-mvc-5-0-application.aspx</id><published>2016-03-07T07:52:00Z</published><updated>2016-03-07T07:52:00Z</updated><content type="html">This is the second post in a series of posts regarding passing multiple models in a view.You can find the first one here We do know that in any MVC application we cannot pass multiple models from a controller to a single view. In this post I will provide you with a workaround for passing multiple models in a single view in MVC. In object-oriented and functional programming, an immutable object is an object whose state cannot be modified after it is created. A Tuple object is an immutable, fixed-size...(&lt;a href="https://www.dotnetzone.gr:443https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2016/03/06/passing-multiple-models-to-a-view-using-tuples-in-an-asp-net-mvc-5-0-application.aspx"&gt;read more&lt;/a&gt;)&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=77619" width="1" height="1"&gt;</content><author><name>nikolaosk</name><uri>https://www.dotnetzone.gr:443/cs/members/nikolaosk.aspx</uri></author><category term="Entity framework" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/Entity+framework/default.aspx" /><category term="ASP.NET MVC" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/ASP.NET+MVC/default.aspx" /><category term="asp.net mvc 5.0" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/asp.net+mvc+5.0/default.aspx" /></entry><entry><title>Passing multiple models to a view in an ASP.Net MVC 5.0 application</title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2016/03/06/passing-multiple-models-to-a-view-in-an-asp-net-mvc-5-0-application.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2016/03/06/passing-multiple-models-to-a-view-in-an-asp-net-mvc-5-0-application.aspx</id><published>2016-03-07T00:23:10Z</published><updated>2016-03-07T00:23:10Z</updated><content type="html">We do know that in any MVC applicatin we cannot pass multiple models from a controller to a single view. In this post I will provide you with a workaround for passing multiple models in a single view in MVC. There are several approaches to achieve this but I will use the List&amp;lt;object&amp;gt; and the object object. I am going to use EF as my data access layer. More specifically I will use the Database First approach in EF. Entity Framework is an object-relational mapping (ORM) framework for the .NET...(&lt;a href="https://www.dotnetzone.gr:443https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2016/03/06/passing-multiple-models-to-a-view-in-an-asp-net-mvc-5-0-application.aspx"&gt;read more&lt;/a&gt;)&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=77618" width="1" height="1"&gt;</content><author><name>nikolaosk</name><uri>https://www.dotnetzone.gr:443/cs/members/nikolaosk.aspx</uri></author><category term="asp.net" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/asp.net/default.aspx" /><category term="Entity framework" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/Entity+framework/default.aspx" /><category term="visual studio 2015" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/visual+studio+2015/default.aspx" /><category term="asp.net mvc 5.0" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/asp.net+mvc+5.0/default.aspx" /></entry><entry><title>Handling concurrency in Code First ASP.Net 5.0 MVC applications</title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2016/02/29/handling-concurrency-in-code-first-asp-net-5-0-mvc-applications.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2016/02/29/handling-concurrency-in-code-first-asp-net-5-0-mvc-applications.aspx</id><published>2016-02-29T10:10:00Z</published><updated>2016-02-29T10:10:00Z</updated><content type="html">In this post I am going to provide you with a hands on example on how to handle concurrency in an EF Code First ASP.Net MVC 5.0 application. Basically I want to show you how to handle conflicts when multiple users update the same entity at the same time . You can find another post regarding concurrency with EF Database First and web forms here . When we are talking about concurrency in an application where EF acts as the data access layer, our main focus is how to make sure that the integrity of...(&lt;a href="https://www.dotnetzone.gr:443https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2016/02/29/handling-concurrency-in-code-first-asp-net-5-0-mvc-applications.aspx"&gt;read more&lt;/a&gt;)&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=77612" width="1" height="1"&gt;</content><author><name>nikolaosk</name><uri>https://www.dotnetzone.gr:443/cs/members/nikolaosk.aspx</uri></author></entry><entry><title>Caching an ASP.Net MVC 5.0 application</title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2016/02/28/caching-an-asp-net-mvc-5-0-application.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2016/02/28/caching-an-asp-net-mvc-5-0-application.aspx</id><published>2016-02-29T04:46:00Z</published><updated>2016-02-29T04:46:00Z</updated><content type="html">In this post I am going to provide you with a hands on example on using caching in an ASP.Net MVC 5.0 application using Visual Studio 2015 and C# . More particularly I'll show you how to use the underlying ASP.net caching engine to improve the performance of an application. There is a number of different cache settings you can use.These settings are all available from the underlying ASP.net cache engine. It's the same engine that Web Forms uses. It's not something that's specific to just the MVC...(&lt;a href="https://www.dotnetzone.gr:443https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2016/02/28/caching-an-asp-net-mvc-5-0-application.aspx"&gt;read more&lt;/a&gt;)&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=77611" width="1" height="1"&gt;</content><author><name>nikolaosk</name><uri>https://www.dotnetzone.gr:443/cs/members/nikolaosk.aspx</uri></author></entry><entry><title>Using MongoDB with ASP.Net MVC</title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2015/11/07/using-mongodb-with-asp-net-mvc.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2015/11/07/using-mongodb-with-asp-net-mvc.aspx</id><published>2015-11-08T05:41:00Z</published><updated>2015-11-08T05:41:00Z</updated><content type="html">In this post I am going to demonstrate with a hands-on example how to use the popular NoSQL database MongoDB to store and retrieve data using Visual Studio 2015and ASP.Net MVC. When creating an application, any type of application (web, windows, distributed) all the data is stored and retrieved from a database. The most popular kind of databases that we are using to store and retrieve data are called Relational Databases and I have been using SQL Server as the RDBMS of choice for many years now....(&lt;a href="https://www.dotnetzone.gr:443https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2015/11/07/using-mongodb-with-asp-net-mvc.aspx"&gt;read more&lt;/a&gt;)&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=77460" width="1" height="1"&gt;</content><author><name>nikolaosk</name><uri>https://www.dotnetzone.gr:443/cs/members/nikolaosk.aspx</uri></author><category term="ASP.NET MVC" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/ASP.NET+MVC/default.aspx" /><category term="JSON" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/JSON/default.aspx" /><category term="MongoDB" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/MongoDB/default.aspx" /><category term="NoSQL" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/NoSQL/default.aspx" /></entry><entry><title>Using Asynchronous Operations in Entity Framework 6.0 and ASP.Net MVC</title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2015/10/17/using-asynchronous-operations-in-entity-framework-6-0-and-asp-net-mvc.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2015/10/17/using-asynchronous-operations-in-entity-framework-6-0-and-asp-net-mvc.aspx</id><published>2015-10-17T08:31:00Z</published><updated>2015-10-17T08:31:00Z</updated><content type="html">In this post I am going to provide you with a hands-on example on how to take advantage of asynchronous execution using Entity Framework. EF 6 has the ability to execute a query and command asynchronously using DbContext. Entity Framework is an object-relational mapping (ORM) framework for the .NET Framework.EF addresses the problem of Object-relational impedance mismatch. I will not be talking about that mismatch because it is well documented in many sites on the Internet. Through that framework...(&lt;a href="https://www.dotnetzone.gr:443https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2015/10/17/using-asynchronous-operations-in-entity-framework-6-0-and-asp-net-mvc.aspx"&gt;read more&lt;/a&gt;)&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=77334" width="1" height="1"&gt;</content><author><name>nikolaosk</name><uri>https://www.dotnetzone.gr:443/cs/members/nikolaosk.aspx</uri></author><category term="Entity framework" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/Entity+framework/default.aspx" /><category term="LINQ to Entities" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/LINQ+to+Entities/default.aspx" /><category term="Entity Framework 6.0" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/Entity+Framework+6.0/default.aspx" /><category term="Asynchronous" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/Asynchronous/default.aspx" /></entry><entry><title>Entity Framework Performance optimization patterns-part II</title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2015/10/12/entity-framework-performance-optimization-patterns-part-ii.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2015/10/12/entity-framework-performance-optimization-patterns-part-ii.aspx</id><published>2015-10-12T08:44:00Z</published><updated>2015-10-12T08:44:00Z</updated><content type="html">This is the second post in a series of posts where I talk about good coding practices when it comes to using Entity Framework as our data access layer when building our applications. You can read the first post of the series here . The main things to take away from that first post is to use projection whenever possible (do not query sql server for data that you do not want on the client) and to filter on the server (meaning SQL Server) which has a powerful engine to do that and not on the client....(&lt;a href="https://www.dotnetzone.gr:443https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2015/10/12/entity-framework-performance-optimization-patterns-part-ii.aspx"&gt;read more&lt;/a&gt;)&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=77312" width="1" height="1"&gt;</content><author><name>nikolaosk</name><uri>https://www.dotnetzone.gr:443/cs/members/nikolaosk.aspx</uri></author><category term="asp.net" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/asp.net/default.aspx" /><category term="Entity framework" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/Entity+framework/default.aspx" /><category term="LINQ to Entities" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/LINQ+to+Entities/default.aspx" /><category term="asp.net web forms" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/asp.net+web+forms/default.aspx" /></entry><entry><title>Entity Framework Performance optimization patterns</title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2015/10/03/entity-framework-performance-optimization-patterns.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2015/10/03/entity-framework-performance-optimization-patterns.aspx</id><published>2015-10-04T04:57:00Z</published><updated>2015-10-04T04:57:00Z</updated><content type="html">In this post I am going to provide you with a hands-on example on how to avoid writing your LINQ to Entities queries in a way that will hinder performance of your application. The aim of this post (hopefully a series of posts on performance and Entity Framework) is to highlight bad coding practices when architecting an applications that uses EF as the ORM to fetch and manipulate data from the data store. I am going to point out some practises and patterns that very often developers use and cause...(&lt;a href="https://www.dotnetzone.gr:443https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2015/10/03/entity-framework-performance-optimization-patterns.aspx"&gt;read more&lt;/a&gt;)&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=77284" width="1" height="1"&gt;</content><author><name>nikolaosk</name><uri>https://www.dotnetzone.gr:443/cs/members/nikolaosk.aspx</uri></author><category term="asp.net" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/asp.net/default.aspx" /><category term="C#" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/C_2300_/default.aspx" /><category term="Entity framework" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/Entity+framework/default.aspx" /><category term="performance" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/performance/default.aspx" /><category term="Visual Studio 2013" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/Visual+Studio+2013/default.aspx" /><category term="Entity Framework 6.0" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/Entity+Framework+6.0/default.aspx" /><category term="asp.net web forms" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/asp.net+web+forms/default.aspx" /></entry><entry><title>Using Second Level Cache in Entity Framework 6.1 applications</title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2015/06/28/using-second-level-cache-in-entity-framework-6-1-applications.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2015/06/28/using-second-level-cache-in-entity-framework-6-1-applications.aspx</id><published>2015-06-28T09:00:00Z</published><updated>2015-06-28T09:00:00Z</updated><content type="html">In this post I am going to provide you with a hands-on example on how to use second level caching with Entity Framework 6.0 version. Second Level Caching is one of the features that is not present out-of-the-box in Entity Framework. Second level cache is a query cache. The results of SQL commands are stored in the cache, so that the same SQL commands retrieve their data from the Cache rather than executing the query again against the underlying provider. This can have a performance boost for your...(&lt;a href="https://www.dotnetzone.gr:443https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2015/06/28/using-second-level-cache-in-entity-framework-6-1-applications.aspx"&gt;read more&lt;/a&gt;)&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=77117" width="1" height="1"&gt;</content><author><name>nikolaosk</name><uri>https://www.dotnetzone.gr:443/cs/members/nikolaosk.aspx</uri></author><category term="Entity framework" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/Entity+framework/default.aspx" /><category term="caching" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/caching/default.aspx" /><category term="LINQ to Entities" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/LINQ+to+Entities/default.aspx" /><category term="Entity Framework 6.0" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/Entity+Framework+6.0/default.aspx" /></entry><entry><title>Database Command Logging &amp; Profiling in Entity Framework 6.0</title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2015/06/16/database-command-logging-amp-profiling-in-entity-framework-6-0.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2015/06/16/database-command-logging-amp-profiling-in-entity-framework-6-0.aspx</id><published>2015-06-17T05:56:00Z</published><updated>2015-06-17T05:56:00Z</updated><content type="html">In this post I am going to provide you with a hands-on example on how to log commands &amp;amp; queries sent to the database by Entity Framework 6.0. You can use the fantastic Entity Framework third party profiler by Hibernating Rhinos if you want. You can find a similar post here . Entity Framework is an object-relational mapping (ORM) framework for the .NET Framework.EF addresses the problem of Object-relational impedance mismatch. I will not be talking about that mismatch because it is well documented...(&lt;a href="https://www.dotnetzone.gr:443https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2015/06/16/database-command-logging-amp-profiling-in-entity-framework-6-0.aspx"&gt;read more&lt;/a&gt;)&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=77098" width="1" height="1"&gt;</content><author><name>nikolaosk</name><uri>https://www.dotnetzone.gr:443/cs/members/nikolaosk.aspx</uri></author><category term="Entity framework" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/Entity+framework/default.aspx" /><category term="LINQ to Entities" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/LINQ+to+Entities/default.aspx" /><category term="Profiling" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/Profiling/default.aspx" /><category term="Entity Framework 6.0" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/Entity+Framework+6.0/default.aspx" /></entry><entry><title>Handling batch operations with Entity Framework and Entity Framework Extended library</title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2015/06/06/handling-batch-operations-with-entity-framework-and-entity-framework-extended-library.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2015/06/06/handling-batch-operations-with-entity-framework-and-entity-framework-extended-library.aspx</id><published>2015-06-07T04:16:00Z</published><updated>2015-06-07T04:16:00Z</updated><content type="html">In this post I am going to provide you with a hands-on example on how to handle efficiently batch operations with Entity Framework and the EF Extended library . You can find another similar post where I demonstrate how to handle batch opration with Entity Framework and the EF Utilities library. Entity Framework is an object-relational mapping (ORM) framework for the .NET Framework.EF addresses the problem of Object-relational impedance mismatch. I will not be talking about that mismatch because it...(&lt;a href="https://www.dotnetzone.gr:443https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2015/06/06/handling-batch-operations-with-entity-framework-and-entity-framework-extended-library.aspx"&gt;read more&lt;/a&gt;)&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=77085" width="1" height="1"&gt;</content><author><name>nikolaosk</name><uri>https://www.dotnetzone.gr:443/cs/members/nikolaosk.aspx</uri></author></entry><entry><title>Handling batch operations with Entity Framework and EF Utilities</title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2015/06/02/handling-batch-operations-with-entity-framework-and-ef-utilities.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2015/06/02/handling-batch-operations-with-entity-framework-and-ef-utilities.aspx</id><published>2015-06-03T06:52:00Z</published><updated>2015-06-03T06:52:00Z</updated><content type="html">In this post I am going to provide you with a hands-on example on how to handle efficiently batch operations with Entity Framework and the EF Utilities library. Entity Framework is an object-relational mapping (ORM) framework for the .NET Framework.EF addresses the problem of Object-relational impedance mismatch. I will not be talking about that mismatch because it is well documented in many sites on the Internet. Through that framework we can program against a conceptual application model instead...(&lt;a href="https://www.dotnetzone.gr:443https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2015/06/02/handling-batch-operations-with-entity-framework-and-ef-utilities.aspx"&gt;read more&lt;/a&gt;)&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=77079" width="1" height="1"&gt;</content><author><name>nikolaosk</name><uri>https://www.dotnetzone.gr:443/cs/members/nikolaosk.aspx</uri></author><category term="Entity framework" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/Entity+framework/default.aspx" /><category term="performance" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/performance/default.aspx" /><category term="Database First" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/Database+First/default.aspx" /><category term="EF Utilities" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/EF+Utilities/default.aspx" /><category term="Visual Studio 2013" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/Visual+Studio+2013/default.aspx" /></entry><entry><title>Using Stored Procedures in an ASP.Net MVC 5.0 application using Entity Framework 6.0</title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2015/03/29/using-stored-procedures-in-an-asp-net-mvc-5-0-application-using-entity-framework-6-0.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2015/03/29/using-stored-procedures-in-an-asp-net-mvc-5-0-application-using-entity-framework-6-0.aspx</id><published>2015-03-29T08:25:00Z</published><updated>2015-03-29T08:25:00Z</updated><content type="html">In this post I will be looking into EF 6.0 using the Code First Workflow and its support for stored procedures. I will be building a simple ASP.Net MVC 5.0 application that will be the client application that will consume the Entity Framework data access layer. I will be using Visual Studio 2013,C# 5.0 and LocalDb in this demo. While I am building this simple ASP.Net application I will point out to various tools and option in VS 2013 that make the completion of an application faster. I will be writing...(&lt;a href="https://www.dotnetzone.gr:443https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2015/03/29/using-stored-procedures-in-an-asp-net-mvc-5-0-application-using-entity-framework-6-0.aspx"&gt;read more&lt;/a&gt;)&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=76846" width="1" height="1"&gt;</content><author><name>nikolaosk</name><uri>https://www.dotnetzone.gr:443/cs/members/nikolaosk.aspx</uri></author></entry><entry><title>What is New in ASP.NET 5 and MVC 6</title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2015/03/15/what-is-new-in-asp-net-5-and-mvc-6.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2015/03/15/what-is-new-in-asp-net-5-and-mvc-6.aspx</id><published>2015-03-16T05:37:00Z</published><updated>2015-03-16T05:37:00Z</updated><content type="html">In the past few weeks I was looking into the new changes that have been made in the current beta release of ASP.NET 5.0. In this post I will talk about those new changes and what impressed me most. There have been many changes and in my opinion this release is the most important , significant release since the ASP.Net introduction. If you want to install it and write some ASP.Net 5 code first you need to download the latest CTP of Visual Studio 2015 which was made available a few weeks back. Let...(&lt;a href="https://www.dotnetzone.gr:443https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2015/03/15/what-is-new-in-asp-net-5-and-mvc-6.aspx"&gt;read more&lt;/a&gt;)&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=76713" width="1" height="1"&gt;</content><author><name>nikolaosk</name><uri>https://www.dotnetzone.gr:443/cs/members/nikolaosk.aspx</uri></author><category term="ASP.Net MVC 6.0" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/ASP.Net+MVC+6.0/default.aspx" /><category term="VS 2015" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/VS+2015/default.aspx" /><category term="ASP.Net 5.0" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/ASP.Net+5.0/default.aspx" /></entry><entry><title>Looking into the JQuery Roundabout Plugin</title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2014/06/03/looking-into-the-jquery-roundabout-plugin.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2014/06/03/looking-into-the-jquery-roundabout-plugin.aspx</id><published>2014-06-03T08:53:00Z</published><updated>2014-06-03T08:53:00Z</updated><content type="html">I have been using JQuery for a couple of years now and it has helped me to solve many problems on the client side of web development. You can find all my posts about JQuery in this link . In this post I will be providing you with a hands-on example on the JQuery Roundabout Plugin . This is a plugin that supports circular rotating display for content. It supports autoplay. In this hands-on example I will be using Expression Web 4.0.This application is not a free application. You can use any HTML editor...(&lt;a href="https://www.dotnetzone.gr:443https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2014/06/03/looking-into-the-jquery-roundabout-plugin.aspx"&gt;read more&lt;/a&gt;)&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=75446" width="1" height="1"&gt;</content><author><name>nikolaosk</name><uri>https://www.dotnetzone.gr:443/cs/members/nikolaosk.aspx</uri></author><category term="jquery" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/jquery/default.aspx" /><category term="jquery RoundAbout plugin" scheme="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/tags/jquery+RoundAbout+plugin/default.aspx" /></entry><entry><title>Looking into temporary tables in SQL Server</title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2013/12/04/looking-into-temporary-tables-in-sql-server.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/dotnetrules/archive/2013/12/04/looking-into-temporary-tables-in-sql-server.aspx</id><published>2013-12-05T03:11:00Z</published><updated>2013-12-05T03:11:00Z</updated><content type="html">&lt;p style="font-family:ubuntu-1, ubuntu-2, 'Open Sans', Helvetica, Arial, sans-serif;font-size:12.800000190734863px;line-height:19px;"&gt;I have been delivering a certified course in MS SQL Server 2012 recently and I was asked several questions about&amp;nbsp;temporary tables, how to create them, how to manage them, when to use them and what are the limitations of them.&lt;/p&gt;&lt;p style="font-family:ubuntu-1, ubuntu-2, 'Open Sans', Helvetica, Arial, sans-serif;font-size:12.800000190734863px;line-height:19px;"&gt;In this post I will try to shed light on this particular issue with lots of hands-on demos.&lt;/p&gt;&lt;p style="font-family:ubuntu-1, ubuntu-2, 'Open Sans', Helvetica, Arial, sans-serif;font-size:12.800000190734863px;line-height:19px;"&gt;Temporary tables and table variables make use of the system&amp;nbsp;&lt;b&gt;tempdb&lt;/b&gt;&amp;nbsp;database.&lt;/p&gt;&lt;p style="font-family:ubuntu-1, ubuntu-2, 'Open Sans', Helvetica, Arial, sans-serif;font-size:12.800000190734863px;line-height:19px;"&gt;I have installed&amp;nbsp;&lt;b&gt;SQL Server 2012 Enterprise edition&lt;/b&gt;&amp;nbsp;in my machine but you can use the&amp;nbsp;&lt;b&gt;SQL Server 2012/2008 Express edition&lt;/b&gt;&amp;nbsp;as well.&lt;/p&gt;&lt;p style="font-family:ubuntu-1, ubuntu-2, 'Open Sans', Helvetica, Arial, sans-serif;font-size:12.800000190734863px;line-height:19px;"&gt;I am connecting to my local instance through&amp;nbsp;&lt;b&gt;Windows Authentication&lt;/b&gt;&amp;nbsp;and in a new query window I type (you can copy paste)&lt;/p&gt;&lt;p style="font-family:ubuntu-1, ubuntu-2, 'Open Sans', Helvetica, Arial, sans-serif;font-size:12.800000190734863px;line-height:19px;"&gt;First I am going to create a new temporary table and populate it. Execute the script below.&lt;/p&gt;&lt;pre style="font-size:12px;line-height:18px;font-family:Consolas, Monaco, monospace;"&gt;&lt;br&gt;USE tempdb&lt;br&gt;GO&lt;br&gt;&lt;br&gt;IF OBJECT_ID('tempdb..#footballer') IS NOT NULL&lt;br&gt;&lt;br&gt;DROP TABLE #footballer;&lt;br&gt;&lt;br&gt;GO&lt;br&gt;CREATE TABLE #footballer&lt;br&gt; (&lt;br&gt; [FootballerID] INT IDENTITY NOT NULL PRIMARY KEY,&lt;br&gt; [lastname] [varchar](15) NOT NULL,&lt;br&gt; [firstname] [varchar](15) NOT NULL,&lt;br&gt; [shirt_no] [tinyint] NOT NULL,&lt;br&gt; [position_played] [varchar](30) NOT NULL,&lt;br&gt;&lt;br&gt;);&lt;br&gt;&lt;br&gt;GO&lt;br&gt;&lt;br&gt;SET IDENTITY_INSERT [dbo].[#footballer] ON&lt;br&gt;&lt;br&gt;GO&lt;br&gt;&lt;br&gt;INSERT [#footballer] ([FootballerID], [lastname],&lt;/pre&gt;&lt;pre style="font-size:12px;line-height:18px;font-family:Consolas, Monaco, monospace;"&gt; [firstname], [shirt_no], [position_played]) &lt;/pre&gt;&lt;pre style="font-size:12px;line-height:18px;font-family:Consolas, Monaco, monospace;"&gt;VALUES (1,N'Oliver', N'Regina', 4, N'goalkeeper')&lt;br&gt;INSERT [#footballer] ([FootballerID], [lastname],&lt;/pre&gt;&lt;pre style="font-size:12px;line-height:18px;font-family:Consolas, Monaco, monospace;"&gt; [firstname], [shirt_no], [position_played])&lt;/pre&gt;&lt;pre style="font-size:12px;line-height:18px;font-family:Consolas, Monaco, monospace;"&gt; VALUES (2,N'Alexander', N'Roy', 8, N'goalkeeper')&lt;br&gt;INSERT [#footballer] ([FootballerID], [lastname], &lt;/pre&gt;&lt;pre style="font-size:12px;line-height:18px;font-family:Consolas, Monaco, monospace;"&gt;[firstname], [shirt_no], [position_played]) &lt;/pre&gt;&lt;pre style="font-size:12px;line-height:18px;font-family:Consolas, Monaco, monospace;"&gt;VALUES (3,N'Mueller', N'Dewayne', 10, N'defender')&lt;br&gt;INSERT [#footballer] ([FootballerID], [lastname], &lt;/pre&gt;&lt;pre style="font-size:12px;line-height:18px;font-family:Consolas, Monaco, monospace;"&gt;[firstname], [shirt_no], [position_played]) &lt;/pre&gt;&lt;pre style="font-size:12px;line-height:18px;font-family:Consolas, Monaco, monospace;"&gt;VALUES (4,N'Buckley', N'Beth', 3, N'midfielder')&lt;br&gt;INSERT [#footballer] ([FootballerID], [lastname],&lt;/pre&gt;&lt;pre style="font-size:12px;line-height:18px;font-family:Consolas, Monaco, monospace;"&gt; [firstname], [shirt_no], [position_played])&lt;/pre&gt;&lt;pre style="font-size:12px;line-height:18px;font-family:Consolas, Monaco, monospace;"&gt; VALUES (5,N'Koch', N'Jolene', 7, N'striker')&lt;br&gt;GO&lt;br&gt;&lt;br&gt;SELECT * FROM #footballer&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;/pre&gt;&lt;p style="font-family:ubuntu-1, ubuntu-2, 'Open Sans', Helvetica, Arial, sans-serif;font-size:12.800000190734863px;line-height:19px;"&gt;As you can see there is a&amp;nbsp;&lt;b&gt;#&lt;/b&gt;&amp;nbsp;prefix in front of the table. This table will be saved in the&amp;nbsp;&lt;b&gt;tempdb&lt;/b&gt;.&lt;/p&gt;&lt;p style="font-family:ubuntu-1, ubuntu-2, 'Open Sans', Helvetica, Arial, sans-serif;font-size:12.800000190734863px;line-height:19px;"&gt;Finally I select everything from the temporary table.&lt;/p&gt;&lt;p style="font-family:ubuntu-1, ubuntu-2, 'Open Sans', Helvetica, Arial, sans-serif;font-size:12.800000190734863px;line-height:19px;"&gt;If I open a new query window and try to select everything (see the query below) from the&amp;nbsp;&lt;b&gt;#footballer&lt;/b&gt;&amp;nbsp;table.&lt;/p&gt;&lt;pre style="font-size:12px;line-height:18px;font-family:Consolas, Monaco, monospace;"&gt;&lt;br&gt;&lt;br&gt;USE tempdb&lt;br&gt;GO&lt;br&gt;&lt;br&gt;SELECT * FROM #footballer&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;/pre&gt;&lt;p style="font-family:ubuntu-1, ubuntu-2, 'Open Sans', Helvetica, Arial, sans-serif;font-size:12.800000190734863px;line-height:19px;"&gt;You will not receive any results. You will receive an error -&amp;nbsp;&lt;b&gt;Invalid object name '#footballer'.&lt;/b&gt;&lt;/p&gt;&lt;p style="font-family:ubuntu-1, ubuntu-2, 'Open Sans', Helvetica, Arial, sans-serif;font-size:12.800000190734863px;line-height:19px;"&gt;This is a local temporary table and it is in scope only in the current connection-session.&lt;/p&gt;&lt;p style="font-family:ubuntu-1, ubuntu-2, 'Open Sans', Helvetica, Arial, sans-serif;font-size:12.800000190734863px;line-height:19px;"&gt;We can also create global temporary tables. In a new query window execute the following script.&lt;/p&gt;&lt;pre style="font-size:12px;line-height:18px;font-family:Consolas, Monaco, monospace;"&gt;&lt;br&gt;USE tempdb&lt;br&gt;GO&lt;br&gt;&lt;br&gt;IF OBJECT_ID('tempdb..##footballernew') IS NOT NULL&lt;br&gt;&lt;br&gt;DROP TABLE ##footballernew;&lt;br&gt;&lt;br&gt;GO&lt;br&gt;CREATE TABLE #footballernew&lt;br&gt;(&lt;br&gt;[FootballerID] INT IDENTITY NOT NULL PRIMARY KEY,&lt;br&gt;[lastname] [varchar](15) NOT NULL,&lt;br&gt;[firstname] [varchar](15) NOT NULL,&lt;br&gt;[shirt_no] [tinyint] NOT NULL,&lt;br&gt;[position_played] [varchar](30) NOT NULL,&lt;br&gt;&lt;br&gt;);&lt;br&gt;&lt;br&gt;GO&lt;br&gt;&lt;br&gt;SET IDENTITY_INSERT [dbo].[##footballernew] ON&lt;br&gt;&lt;br&gt;GO&lt;br&gt;&lt;br&gt;INSERT [##footballernew] ([FootballerID], [lastname],&lt;/pre&gt;&lt;pre style="font-size:12px;line-height:18px;font-family:Consolas, Monaco, monospace;"&gt; [firstname], [shirt_no], [position_played]) &lt;/pre&gt;&lt;pre style="font-size:12px;line-height:18px;font-family:Consolas, Monaco, monospace;"&gt;VALUES (1,N'Oliver', N'Regina', 4, N'goalkeeper')&lt;br&gt;INSERT [##footballernew] ([FootballerID], [lastname],&lt;/pre&gt;&lt;pre style="font-size:12px;line-height:18px;font-family:Consolas, Monaco, monospace;"&gt; [firstname], [shirt_no], [position_played]) &lt;/pre&gt;&lt;pre style="font-size:12px;line-height:18px;font-family:Consolas, Monaco, monospace;"&gt;VALUES (2,N'Alexander', N'Roy', 8, N'goalkeeper')&lt;br&gt;INSERT [##footballernew] ([FootballerID], [lastname], &lt;/pre&gt;&lt;pre style="font-size:12px;line-height:18px;font-family:Consolas, Monaco, monospace;"&gt;[firstname], [shirt_no], [position_played]) &lt;/pre&gt;&lt;pre style="font-size:12px;line-height:18px;font-family:Consolas, Monaco, monospace;"&gt;VALUES (3,N'Mueller', N'Dewayne', 10, N'defender')&lt;br&gt;INSERT [##footballernew] ([FootballerID], [lastname],&lt;/pre&gt;&lt;pre style="font-size:12px;line-height:18px;font-family:Consolas, Monaco, monospace;"&gt; [firstname], [shirt_no], [position_played])&lt;/pre&gt;&lt;pre style="font-size:12px;line-height:18px;font-family:Consolas, Monaco, monospace;"&gt; VALUES (4,N'Buckley', N'Beth', 3, N'midfielder')&lt;br&gt;INSERT [##footballernew] ([FootballerID], [lastname],&lt;/pre&gt;&lt;pre style="font-size:12px;line-height:18px;font-family:Consolas, Monaco, monospace;"&gt; [firstname], [shirt_no], [position_played])&lt;/pre&gt;&lt;pre style="font-size:12px;line-height:18px;font-family:Consolas, Monaco, monospace;"&gt; VALUES (5,N'Koch', N'Jolene', 7, N'striker')&lt;br&gt;GO&lt;br&gt;&lt;br&gt;SELECT * FROM ##footballernew&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;/pre&gt;&lt;p style="font-family:ubuntu-1, ubuntu-2, 'Open Sans', Helvetica, Arial, sans-serif;font-size:12.800000190734863px;line-height:19px;"&gt;We denote the global temporary table with&amp;nbsp;&lt;b&gt;##&lt;/b&gt;&amp;nbsp;-&amp;nbsp;&lt;b&gt;##footballernew&lt;/b&gt;&lt;/p&gt;&lt;p style="font-family:ubuntu-1, ubuntu-2, 'Open Sans', Helvetica, Arial, sans-serif;font-size:12.800000190734863px;line-height:19px;"&gt;The global temporary table is deleted when all users referencing the table disconnect.&lt;/p&gt;&lt;p style="font-family:ubuntu-1, ubuntu-2, 'Open Sans', Helvetica, Arial, sans-serif;font-size:12.800000190734863px;line-height:19px;"&gt;Both global and local temporary tables should be deleted in code rather than depending on automatic drop.&lt;/p&gt;&lt;p style="font-family:ubuntu-1, ubuntu-2, 'Open Sans', Helvetica, Arial, sans-serif;font-size:12.800000190734863px;line-height:19px;"&gt;A temporary table created in a stored procedure is visible to other stored procedures executed from within the first procedure.&lt;/p&gt;&lt;p style="font-family:ubuntu-1, ubuntu-2, 'Open Sans', Helvetica, Arial, sans-serif;font-size:12.800000190734863px;line-height:19px;"&gt;In a new query window type the following.&lt;/p&gt;&lt;pre style="font-size:12px;line-height:18px;font-family:Consolas, Monaco, monospace;"&gt;&lt;br&gt;&lt;br&gt;USE tempdb&lt;br&gt;GO&lt;br&gt;&lt;br&gt;SELECT * FROM ##footballernew&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;/pre&gt;&lt;p style="font-family:ubuntu-1, ubuntu-2, 'Open Sans', Helvetica, Arial, sans-serif;font-size:12.800000190734863px;line-height:19px;"&gt;In this case there will be no error. Global temporary tables persist across sessions-connections.&lt;/p&gt;&lt;p style="font-family:ubuntu-1, ubuntu-2, 'Open Sans', Helvetica, Arial, sans-serif;font-size:12.800000190734863px;line-height:19px;"&gt;You can also add columns to temporary tables and alter the definition of existing columns.&lt;/p&gt;&lt;p style="font-family:ubuntu-1, ubuntu-2, 'Open Sans', Helvetica, Arial, sans-serif;font-size:12.800000190734863px;line-height:19px;"&gt;In this script I add another column and then alter the definition of an existing column.&lt;/p&gt;&lt;pre style="font-size:12px;line-height:18px;font-family:Consolas, Monaco, monospace;"&gt;&lt;br&gt;&lt;br&gt;USE tempdb&lt;br&gt;GO&lt;br&gt;&lt;br&gt;IF OBJECT_ID('tempdb..#footballer') IS NOT NULL&lt;br&gt;&lt;br&gt;DROP TABLE #footballer;&lt;br&gt;&lt;br&gt;GO&lt;br&gt;CREATE TABLE #footballer&lt;br&gt; (&lt;br&gt; [FootballerID] INT IDENTITY NOT NULL PRIMARY KEY,&lt;br&gt; [lastname] [varchar](15) NOT NULL,&lt;br&gt; [firstname] [varchar](15) NOT NULL,&lt;br&gt; [shirt_no] [tinyint] NOT NULL,&lt;br&gt; [position_played] [varchar](30) NOT NULL,&lt;br&gt;&lt;br&gt;);&lt;br&gt;&lt;br&gt;GO&lt;br&gt;&lt;br&gt;SET IDENTITY_INSERT [dbo].[#footballer] ON&lt;br&gt;&lt;br&gt;GO&lt;br&gt;&lt;br&gt;INSERT [#footballer] ([FootballerID], [lastname],&lt;/pre&gt;&lt;pre style="font-size:12px;line-height:18px;font-family:Consolas, Monaco, monospace;"&gt; [firstname], [shirt_no], [position_played]) &lt;/pre&gt;&lt;pre style="font-size:12px;line-height:18px;font-family:Consolas, Monaco, monospace;"&gt;VALUES&lt;span style="font-family:Tahoma, Helvetica, sans-serif;font-size:10pt;"&gt; (1,N'Oliver', N'Regina', 4, N'goalkeeper')&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size:12px;line-height:18px;font-family:Consolas, Monaco, monospace;"&gt;INSERT [#footballer] ([FootballerID], [lastname], &lt;/pre&gt;&lt;pre style="font-size:12px;line-height:18px;font-family:Consolas, Monaco, monospace;"&gt;[firstname], [shirt_no], [position_played])&lt;/pre&gt;&lt;pre style="font-size:12px;line-height:18px;font-family:Consolas, Monaco, monospace;"&gt; VALUES (2,N'Alexander', N'Roy', 8, N'goalkeeper')&lt;br&gt;INSERT [#footballer] ([FootballerID], [lastname],&lt;/pre&gt;&lt;pre style="font-size:12px;line-height:18px;font-family:Consolas, Monaco, monospace;"&gt; [firstname], [shirt_no], [position_played]) &lt;/pre&gt;&lt;pre style="font-size:12px;line-height:18px;font-family:Consolas, Monaco, monospace;"&gt;VALUES (3,N'Mueller', N'Dewayne', 10, N'defender')&lt;br&gt;INSERT [#footballer] ([FootballerID], [lastname], &lt;/pre&gt;&lt;pre style="font-size:12px;line-height:18px;font-family:Consolas, Monaco, monospace;"&gt;[firstname], [shirt_no], [position_played]) &lt;/pre&gt;&lt;pre style="font-size:12px;line-height:18px;font-family:Consolas, Monaco, monospace;"&gt;VALUES (4,N'Buckley', N'Beth', 3, N'midfielder')&lt;br&gt;INSERT [#footballer] ([FootballerID], [lastname], &lt;/pre&gt;&lt;pre style="font-size:12px;line-height:18px;font-family:Consolas, Monaco, monospace;"&gt;[firstname], [shirt_no], [position_played]) &lt;/pre&gt;&lt;pre style="font-size:12px;line-height:18px;font-family:Consolas, Monaco, monospace;"&gt;VALUES (5,N'Koch', N'Jolene', 7, N'striker')&lt;br&gt;GO&lt;br&gt;&lt;br&gt;ALTER TABLE #footballer&lt;br&gt;ADD [is_retired] BIT NULL;&lt;br&gt;GO&lt;br&gt;&lt;br&gt;ALTER TABLE #footballer&lt;br&gt;ALTER COLUMN [lastname] [nvarchar](50);&lt;br&gt;GO&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;/pre&gt;&lt;p style="font-family:ubuntu-1, ubuntu-2, 'Open Sans', Helvetica, Arial, sans-serif;font-size:12.800000190734863px;line-height:19px;"&gt;You can use any data type for columns definition in a temporary table. You can also use user-defined data types.&lt;/p&gt;&lt;p style="font-family:ubuntu-1, ubuntu-2, 'Open Sans', Helvetica, Arial, sans-serif;font-size:12.800000190734863px;line-height:19px;"&gt;You can also have constraints in temporary tables.If you execute the code below, it will work perfectly fine.&lt;/p&gt;&lt;pre style="font-size:12px;line-height:18px;font-family:Consolas, Monaco, monospace;"&gt;&lt;br&gt;&lt;br&gt;USE tempdb&lt;br&gt;GO&lt;br&gt;&lt;br&gt;IF OBJECT_ID('tempdb..#Movies') IS NOT NULL&lt;br&gt;&lt;br&gt;DROP TABLE #footballer;&lt;br&gt;&lt;br&gt;GO&lt;br&gt;&lt;br&gt;CREATE TABLE #Movies&lt;br&gt; (&lt;br&gt; MovieID INT PRIMARY KEY ,&lt;br&gt; MovieName NVARCHAR(50) ,&lt;br&gt; MovieRating TINYINT&lt;br&gt; )&lt;br&gt;GO&lt;br&gt;ALTER TABLE #Movies&lt;br&gt; WITH CHECK&lt;br&gt; ADD CONSTRAINT CK_Movie_Rating&lt;br&gt;CHECK (MovieRating &amp;gt;= 1 AND MovieRating &amp;lt;= 5)&lt;br&gt;&lt;br&gt;&lt;/pre&gt;&lt;p style="font-family:ubuntu-1, ubuntu-2, 'Open Sans', Helvetica, Arial, sans-serif;font-size:12.800000190734863px;line-height:19px;"&gt;But you have to be careful when creating-applying foreign keys.&amp;nbsp;&lt;b&gt;FOREIGN KEY&lt;/b&gt;&amp;nbsp;constraints are not enforced on local or global temporary tables.&lt;br&gt;Execute the script below to see what I mean.The foreign key will not be created.&lt;/p&gt;&lt;pre style="font-size:12px;line-height:18px;font-family:Consolas, Monaco, monospace;"&gt;&lt;br&gt;USE tempdb&lt;br&gt;go&lt;br&gt;&lt;br&gt;CREATE TABLE #Persons&lt;br&gt; (&lt;br&gt; P_Id INT NOT NULL ,&lt;br&gt; LastName VARCHAR(255) NOT NULL ,&lt;br&gt; FirstName VARCHAR(255) ,&lt;br&gt; Address VARCHAR(255) ,&lt;br&gt; City VARCHAR(255) ,&lt;br&gt; PRIMARY KEY ( P_Id )&lt;br&gt; )&lt;br&gt;&lt;br&gt;CREATE TABLE #Orders&lt;br&gt;(&lt;br&gt;O_Id int NOT NULL PRIMARY KEY,&lt;br&gt;OrderNo int NOT NULL,&lt;br&gt;P_Id int FOREIGN KEY REFERENCES #Persons(P_Id)&lt;br&gt;)&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;/pre&gt;&lt;p style="font-family:ubuntu-1, ubuntu-2, 'Open Sans', Helvetica, Arial, sans-serif;font-size:12.800000190734863px;line-height:19px;"&gt;Please bear in mind that you can create temporary tables with clustered and non-clustered indexes on them.&lt;/p&gt;&lt;p style="font-family:ubuntu-1, ubuntu-2, 'Open Sans', Helvetica, Arial, sans-serif;font-size:12.800000190734863px;line-height:19px;"&gt;Let's investigate the behavior of temporary tables and IDENTITY columns.&lt;/p&gt;&lt;p style="font-family:ubuntu-1, ubuntu-2, 'Open Sans', Helvetica, Arial, sans-serif;font-size:12.800000190734863px;line-height:19px;"&gt;If you execute the script below , it will fail. This is the same behavior when executing the same script to regular tables. You cannot specify values for the IDENTITY column.If you choose to do so you must set&amp;nbsp;&lt;b&gt;IDENTITY_INSERT&amp;nbsp;&lt;/b&gt;ON.&lt;/p&gt;&lt;pre style="font-size:12px;line-height:18px;font-family:Consolas, Monaco, monospace;"&gt;&lt;br&gt;USE tempdb&lt;br&gt;GO&lt;br&gt;&lt;br&gt;IF OBJECT_ID('tempdb..#Persons') IS NOT NULL&lt;br&gt;&lt;br&gt;DROP TABLE #Persons;&lt;br&gt;&lt;br&gt;GO&lt;br&gt;&lt;br&gt;CREATE TABLE #Persons&lt;br&gt; (&lt;br&gt; P_Id INT PRIMARY KEY CLUSTERED IDENTITY(1,1) ,&lt;br&gt; LastName VARCHAR(255) NOT NULL ,&lt;br&gt; FirstName VARCHAR(255) ,&lt;br&gt; Address VARCHAR(255) ,&lt;br&gt; City VARCHAR(255)&lt;br&gt; )&lt;br&gt;&lt;br&gt;--this will not work&lt;br&gt;&lt;br&gt;INSERT #Persons(P_Id,LastName,FirstName,Address,City) &lt;/pre&gt;&lt;pre style="font-size:12px;line-height:18px;font-family:Consolas, Monaco, monospace;"&gt;VALUES (1,'Steven','Gerrard','123 liverpool street','liverpool')&lt;br&gt;SET IDENTITY_INSERT [#Persons] ON&lt;br&gt;&lt;br&gt;GO&lt;br&gt;&lt;br&gt;--this will work&lt;br&gt;&lt;br&gt;INSERT #Persons(P_Id,LastName,FirstName,Address,City)&lt;/pre&gt;&lt;pre style="font-size:12px;line-height:18px;font-family:Consolas, Monaco, monospace;"&gt; VALUES (1,'Steven','Gerrard','123 liverpool street','liverpool')&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;/pre&gt;&lt;p style="font-family:ubuntu-1, ubuntu-2, 'Open Sans', Helvetica, Arial, sans-serif;font-size:12.800000190734863px;line-height:19px;"&gt;Αlso note that transactions are honored in temporary tables. If I begin an explicit transaction -an insert- without committing it will insert the row of data but then if a rollback is issued the whole operation will be rolled back&lt;/p&gt;&lt;p style="font-family:ubuntu-1, ubuntu-2, 'Open Sans', Helvetica, Arial, sans-serif;font-size:12.800000190734863px;line-height:19px;"&gt;Execute the script below.&lt;/p&gt;&lt;pre style="font-size:12px;line-height:18px;font-family:Consolas, Monaco, monospace;"&gt;&lt;br&gt;&lt;br&gt;USE tempdb&lt;br&gt;GO&lt;br&gt;&lt;br&gt;IF OBJECT_ID('tempdb..#Persons') IS NOT NULL&lt;br&gt;&lt;br&gt;DROP TABLE #Persons;&lt;br&gt;&lt;br&gt;GO&lt;br&gt;&lt;br&gt;CREATE TABLE #Persons&lt;br&gt; (&lt;br&gt; P_Id INT PRIMARY KEY CLUSTERED IDENTITY(1,1) ,&lt;br&gt; LastName VARCHAR(255) NOT NULL ,&lt;br&gt; FirstName VARCHAR(255) ,&lt;br&gt; Address VARCHAR(255) ,&lt;br&gt; City VARCHAR(255)&lt;br&gt; )&lt;br&gt;&lt;br&gt;SET IDENTITY_INSERT [#Persons] ON&lt;br&gt;&lt;br&gt;GO&lt;br&gt;&lt;br&gt;--this will insert the value&lt;br&gt;&lt;br&gt;BEGIN TRAN&lt;br&gt;INSERT #Persons(P_Id,LastName,FirstName,Address,City)&lt;/pre&gt;&lt;pre style="font-size:12px;line-height:18px;font-family:Consolas, Monaco, monospace;"&gt; VALUES (1,'Steven','Gerrard','123 liverpool street','liverpool')&lt;br&gt;&lt;br&gt;GO&lt;br&gt;&lt;br&gt;SELECT * FROM #Persons&lt;br&gt;&lt;br&gt;--this will rollback the transaction&lt;br&gt;&lt;br&gt;ROLLBACK TRAN&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;/pre&gt;&lt;p style="font-family:ubuntu-1, ubuntu-2, 'Open Sans', Helvetica, Arial, sans-serif;font-size:12.800000190734863px;line-height:19px;"&gt;Hope it helps!!!&lt;/p&gt;&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=74744" width="1" height="1"&gt;</content><author><name>nikolaosk</name><uri>https://www.dotnetzone.gr:443/cs/members/nikolaosk.aspx</uri></author></entry></feed>