.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Fauzul Azmi
Asad Ali

Home >> Interview Question >> Sql Server >> Post New Question Subscribe to Interview Questions

There is a DELETE statement inside a transaction. What happens if the transaction is rolled back?

Posted By :nishithraj     Posted Date :December 24, 2009    Points :10   Category :Sql Server 
Truncation statement cannot be rolled back

You can also find related Interview Question to There is a DELETE statement inside a transaction. What happens if the transaction is rolled back?  below: 

How can we cancel a transaction?


what are the content in Transaction log file backup?


Step 1 : Begin and End Transaction information

step 2 : Modified transaction information

step 3 : create or alter table information or index information (More...)

What precautions should be taken while using dealing with insert, update, delete statement?

1) Always use update and delete statement in transaction i.e by using explicit commit.

2)Before executing update and delete statement, first create them on the basis of select satement.

3)Finally before executing the update and delete query on the production server always keep habit to execute it on the non-production server. (More...)

How does the Transaction topic work in asp ?

In Asp there is an Assembly called System.Transactions which contains classes that allows the applications to work under the transactions which were organized by
Microsoft Distributed Transaction Coordinator (MSDTC ) and
Local Transaction Manager(LTM ).

This System.Transactions assembly allows both implicit and explicit way of operation

The Explicit programming model is based on the Transaction class and
The Implicit programming model using the Transaction Scope class. (More...)

What advantage does a transaction have over a batch or script?

In short A transaction executes as a single unit of work. If a transaction fails, it can be rolled back as a unit, leaving data in a consistent state. (More...)

On a routine monitoring of the data files and transaction log, you notice that the transaction log is extremely close to being full. What will happen if the log fills? What steps can you take to avoid running out of transaction log space?

If the transaction log fills, you are unable to modify the data in the database until the log is archived or expanded. To avoid a full transaction log, you can monitor the log space regularly, expand the log whenever necessary, set the log to grow automatically, and create an alert to notify you when the available log space falls below a specified level (alerts are not covered in this training kit). Scheduling or performing frequent transaction log dumps is the best way to reclaim available space in the transaction log.

Database: What is recorded as transaction log for Truncate ?

Data page deallocation are recorded as transaction log for truncate command.


Datebase: Can Truncate command be rolled back?

Yes, Unless it is used in Transaction.

What is Transaction Propagation? And how WCF support it?

Transaction propagation is the ability to propagate transaction across the boundaries of a single service. Or in other words, we can say that a service can participate in a transaction that is initiated by a client.
In a SOA environment, transaction propagation becomes a key requirement. As we know that WCF supports SOA, so it provides support for transaction propagation as well.
To enable transaction propagation, we need to set the value of TransactionFlow property of the binding being used. This can be done programmatically as follows:
WSHttpBinding bindingBeingUsed = new WSHttpBinding();
bindingBeingUsed.TransactionFlow = "true";
Or It can be done declaratively by updating configuration file as follows:

transactionFlow="true" />

Default value for TransactionFlow property is "False".

Does all WCF bindings support for Transaction Propagation?

No. Not all WCF bindings support transaction propagation. Only following list of bindings support for it.
. wsHttpBinding
. netTcpBinding
. netNamedPipeBinding
. wsDualHttpBinding
. wsFederationHttpBinding

What are the various Transaction Flow Options available in WCF?

If a service is configured for Transaction Propagation, WCF further supports various options for service methods to be part of any transaction initiated outside service boundaries.
. NotAllowed Transaction Propagation is not allowed for particular service method. Its default value.
. Allowed Transaction Propagation is allowed but not compulsory.
. Mandatory Transaction Propagation is compulsory for that service method.
For example, Transaction Propagation is mandatory for CreditAccount service method in following code snippet.
interface IPaymentService
void CreditAccount(..);

What is the role of transaction manager in WCF?

Transaction manager while sitting on client side, initiate the transaction and coordinates with all the processes that participate in a distributed transaction to commit or roll back. (More...)

Difference Between Delete and Truncate

.Delete table is a logged operation, so the deletion of each row gets logged in the transaction log, which makes it slow.

. Truncate table also deletes all the rows in a table, but it won't log the deletion of each row, instead it logs the de-allocation of the data pages of the table, which makes it faster. Of course, truncate table cannot be rolled back.

. Truncate table is functionally identical to delete statement with no "where clause" both remove all rows in the table. But truncate table is faster and uses fewer system and transaction log resources than delete.

. Truncate table removes all rows from a table, but the table structure and its columns, constraints, indexes etc., remains as it is.

. In truncate table the counter used by an identity column for new rows is reset to the seed for the column.

. If you want to retain the identity counter, use delete statement instead.

. If you want to remove table definition and its data, use the drop table statement.

. You cannot use truncate table on a table referenced by a foreign key constraint; instead, use delete statement without a where clause. Because truncate table is not logged, it cannot activate a trigger.

. Truncate table may not be used on tables participating in an indexed view. (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend