Wednesday 25 September 2013

uninstall nuget package visual studio, uninstall nuget package vs 2010

follow this ,
C:\Program Files (x86)\Microsoft Visual Studio10.0\Common7\IDE\Extensions\Microsoft Corporation\NuGet Package Manager

Tuesday 17 September 2013

SQL Server - Acid Properties (Atomicity, Consistency, Isolation, Durability).

Atomicity

It is one unit of work and does not dependent on previous and following transactions. This transaction is either fully completed or not begun at all. Any updates in the system during transaction will complete entirely. If any reason an error occurs and the transaction is unable to complete all of its steps, then the system will returned to the state where transaction was started

Consistency

Data is either committed or roll back, not “in-between” case where something has been updated and something hasn’t and it will never leave your database till transaction finished. If the transaction completes successfully, then all changes to the system will have been properly made, and the system will be in a valid state. If any error occurs in a transaction, then any changes already made will be automatically rolled back. This will return the system to its state before the transaction was started. Since the system was in a consistent state when the transaction was started, it will once again be in a consistent state.

Isolation

No transaction sees the intermediate results of the current transaction. We have two transactions both are performing the same function and running at the same time, the isolation will ensure that each transaction separate from other until both are finished.

Durability

Once transaction completed whatever the changes made to the system will be permanent even if the system crashes right after

Whenever transaction will start each will obey all the acid properties.

Thursday 12 September 2013

Types of Cursors


  • Static Cursors

    A static cursor populates the result set at the time of cursor creation and query result is cached for the lifetime of the cursor. A static cursor can move forward and backward direction. A static cursor is slower and use more memory in comparison to other cursor. Hence you should use it only if scrolling is required and other types of cursors are not suitable.
    You can't update, delete data using static cursor. It is not sensitive to any changes to the original data source. By default static cursors are scrollable.
  • Dynamic Cursors

    A dynamic cursor allows you to see the data updation, deletion and insertion in the data source while the cursor is open. Hence a dynamic cursor is sensitive to any changes to the data source and supports update, delete operations. By default dynamic cursors are scrollable.
  • Forward Only Cursors

    A forward only cursor is the fastest cursor among the all cursors but it doesn't support backward scrolling. You can update, delete data using Forward Only cursor. It is sensitive to any changes to the original data source.
    There are three more types of Forward Only Cursors.Forward_Only KEYSET, FORWARD_ONLY STATIC and FAST_FORWARD.
    FORWARD_ONLY STATIC Cursor is populated at the time of creation and cached the data to the cursor lifetime. It is not sensitive to any changes to the data source.
    FAST_FORWARD Cursor is the fastest cursor and it is not sensitive to any changes to the data source.
  • Keyset Driven Cursors

    A keyset driven cursor is controlled by a set of unique identifiers as the keys in the keyset. The keyset depends on all the rows that qualified the SELECT statement at the time of cursor was opened. A keyset driven cursor is sensitive to any changes to the data source and supports update, delete operations. By default keyset driven cursors are scrollable.
  • Swap the values of two columns in SQL Server


    Do you have fun with SQL Server?. Let's start fun with SQL Server. Suppose you want to swap the values of two columns of a table in SQL Server, how could you achieve this tricky task?. Actually, it is simple and so funny.
    Suppose you have a Customer table in the database with the following data and you want to interchange the values of columns Name and Address then how do you do?
    1. SELECT * FROM CUSTOMER

    Don't worry, to do this task, you need to just write a simple update query for Customer table like as :
    1. UPDATE Customer SET Name=Address , Address=Name
    Now After query execution you will find the the values of columns Name and Address have been interchanged, that's so cool.
    1. SELECT * FROM CUSTOMER

    referred from dot net tricks