Sunday, 22 December 2013

Difference


1. DELETE is a DML Command.
2. DELETE statement is executed using a row lock, each row in the table is locked for deletion.
3. We can specify filters in where clause
4. It deletes specified data if where condition exists.
5. Delete activates a trigger because the operation are logged individually.
6. Slower than truncate because, it keeps logs.
7. Rollback is possible.
TRUNCATE 
1. TRUNCATE is a DDL command.
2. TRUNCATE TABLE always locks the table and page but not each row.
3. Cannot use Where Condition.
4. It Removes all the data.
5. TRUNCATE TABLE cannot activate a trigger because the operation does not log individual row deletions.
6. Faster in performance wise, because it doesn't keep any logs.
7. Rollback is not possible.
TRUNCATE 
1. TRUNCATE is a DDL command.
2. TRUNCATE TABLE always locks the table and page but not each row.
3. Cannot use Where Condition.
4. It Removes all the data.
5. TRUNCATE TABLE cannot activate a trigger because the operation does not log individual row deletions.
6. Faster in performance wise, because it doesn't keep any logs.
7. Rollback is not possible.
Deletes the data as well as structure.
The difference b/w DROP and DELETE table is that, after executing DELETE statement the contents of table are removed but the structure remains same, but in case of DROP statement both the contents and structure are removed.
How ASP.NET different from ASP?

Difference b/w Delete, Truncate, Drop Click here :-
DELETE 


Drop



·                     Asp.Net forms have a code behind file which contains all event handling code But in Asp it doesn't have such facility to separate programming logic form design.
·                     Asp.Net inherits the class written in code behind But in Asp does not have concept of inheritance
·                     Asp.Net use full fledged programming language But Asp it use scripting language.
·                     Asp.Net web application are configuration(web.config) But in Asp there are not.  
Difference B/w Primary key and Unique key.
·                     Primary key is only one in a table but unique key can be more then one.
·                     primary key does not have null value but unique can have one null value.
·                     primary key is by default clustered index but unique is by default non-clustered index.
·                     primary key has reference key in another table and unique key also has reference key in another table.
Clustered index and non clustered index
clustered index is index in with row set are stored in particular format but in non clustered index then is not format.  

Difference B/w Primary key and Foreign key.
·                     Primary key is a unique in table this is only one in a table but primary can be define more then one.
·                     primary key does not have null value but Foreign key have null value.
·                     primary key is by default clustered index. 
Difference B/w ADO and ADO.NET


§     In ADO we have record set and in ADO.NET we have Dataset.
§     In recordset we can only have one table. If we want to accommodate more than one tables we need to do inner join and fill the recordset.
§     Dataset can have multiple tables.
§     All data persist in XML as compared to classic ADO where data persisted in Binary format also.
§     In ADO we have record set and in ADO.NET we have Dataset.
§     In recordset we can only have one table. If we want to accommodate more than one tables we need to do inner join and fill the recordset.
§     Dataset can have multiple tables.
§     All data persist in XML as compared to classic ADO where data persisted in Binary format also.

The difference b/w Data Set  and Data Reader
§     Data Reader provides forward only and read only access to data, while the Data set objects can hold more than one table from the same data source as well as the relationships between them.
§     Dataset is a disconnected architecture while data reader is connected architecture.
§     Dataset can persist contents while data reader cannot persist contents they are forward only.

Difference B/w Data Set & Record set

There are two main differences are :
§     Dataset you an retrieve data from two databases like oracle and sql server and merge them in one dataset.
§     Recordset this is not possible
§     All representation of Dataset is using XML while recordset uses COM.
§     Recordset can not be transmitted on HTTP while Dataset can be.

Difference B/w DataAdepter and Datareader.
SqlDataReader:
·      Holds the connection open until you are finished (don't forget to close it!).
·      Can typically only be iterated over once
·      Is not as useful for updating back to the database
On the other hand, it:
·      Only has one record in memory at a time rather than an entire result set (this can be huge)
·      Is about as fast as it you can get for that one iteration
·      Allows you start processing results sooner
SqlDataAdapter/DataSet
·      Lets you close the connection as soon it's done loading data, and may even close it for you automatically
·      All of the results are available in memory
·      You can iterate over it as many times as you need, or even look up a specific record by index
·      Has some built-in faculties for updating back to the database
At the cost of:
·      Much higher memory use
·      You wait until all the data is loaded before using any of it
Abstract Class V/s Interface 

·                     Abstract class can have implementation for some of its method. But the interface can't have implementation for any of its method.
·                      Abstract class can have field but interface does not have fields.
·                     An Interface can inherit from another interface only can't inherit from another abstract class but an abstract class can inherit from another abstract class and another interface.
·                     Abstract class members can have access modifiers where interface member doesn't have access modifiers.
Structure V/s Class
·                     Class is a reference type so it is stored in Heap. Structure is value type so it is stored in stack.
·                     class has inheritance but structure does not has inheritance.
·                     In class there is constructor But in structure there may be or may not be constructor.
·                     By default class has private access modifier and structure has public modifier. 


2 comments:

  1. Hi munesh delete v/s truncate ..
    in sql you can rollback anything .

    ReplyDelete
    Replies
    1. Delete can be rolled back but Truncate cannot

      Delete

C# program Selection Sorting

Selection sort is a straightforward sorting algorithm. This algorithm search for the smallest number in the elements array and then swap i...