/* ------------------------ My Meta Content Here SEO ------------------------ */

Pages

Main Menu

Thursday, February 12, 2015

SQL SELECT INTO Examples and Linked Server in SQL Server 2008

SQL SELECT INTO Examples Copy table from one database to another Create a linked server to the source server. The easiest way is to right click "Linked Servers" in Management Studio; it's under Management -> Server Objects. Then you can copy the table using a 4-part name, server.database.schema.table: SELECT * INTO DBNAME.DBO.NEWTABLE FROM LINKEDSERVER.DBNAME.DBO.OLDTABLE This will both create the new table with the same structure as the original one and copy...
Read More »

Wednesday, February 4, 2015

Entity Framework (EF) TransactionScope vs Database.BeginTransaction

Entity Framework (EF) TransactionScope vs Database.BeginTransaction In today blog post we will talk a little about a new feature that is available on EF6+ related to Transactions. Until now, when we had to use transaction we used ‘TransactionScope’. It works great and I would say that is something that is now in our blood. using (var scope = new TransactionScope(TransactionScopeOption.Required))...
Read More »

Using Transaction Scope in Entity Framework

Entity Framework transaction scope examples Transactions as a core building block of entity framework. The DbContext object which we heavily use for interacting with the database uses transactions internally without you having to do anything extra. In case you need to manually provide transaction support, here is how you can do it. In this post, I cover three cases in which transaction scope is being used to show rollback when an error occurs during an update of multiple entities: when...
Read More »

My Blog List