![]() |
|
|
By: Jeremy Kadlec | Read Comments (9) | Print Jeremy is the CTO @ Edgewood Solutions, co-founder of MSSQLTips.com and SQL Server MVP since 2009. Related Tips: More |
|
If you are preparing for a SQL Server Developer or DBA interview as the interviewer or interviewee, today's tip should offer value to you. This tip has interview style questions graded as either easy, moderate or advanced related to T-SQL, the relational engine programming language. Check out the questions and answers to help gauge your skills. Good luck!
Question Difficulty = Moderate
Question Difficulty = Advanced
| Share: | Share | Tweet |
|
![]() |
![]() |
Connect with MSSQLTips.com |
| Friday, March 07, 2008 - 7:16:24 AM - aprato | Read The Tip |
|
One thing about TRUNCATE.... truncate is actually a minimally logged command. Page deallocations are recorded. It's possibel to recover from a TRUNCATE if it's done quickly. Here's an example
create table mytable (id int identity) |
|
| Tuesday, March 18, 2008 - 2:40:44 AM - Bals | Read The Tip |
|
no |
|
| Tuesday, March 18, 2008 - 1:09:54 PM - aprato | Read The Tip |
|
Of course it can. Page deallocations are recorded. From the 2005 BOL: ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/3d544eed-3993-4055-983d-ea334f8c5c58.htm TRUNCATE TABLE
removes the data by deallocating the data pages used to store the table data and
records only the page deallocations in the transaction log. There's no guarantee it will work but if done quickly (like, right after the table is truncated as in the sample I supplied) it can actually be done. |
|
| Friday, April 04, 2008 - 7:33:35 AM - admin | Read The Tip |
|
aprato, Agreed TRUNCATE is a minimally logged operation as well as under the code scenario you provide and/or with vendor tool the data can be recovered. Thank you for pointing out those items. Thank you, |
|
| Tuesday, April 08, 2008 - 3:26:22 AM - Bals | Read The Tip |
|
Aprato, Yeah Agreed . Thanks for your valuble info |
|
| Thursday, March 17, 2011 - 12:36:30 PM - John Fox | Read The Tip |
| While it's great to ask technical questions, interviewers are well served finding someone who is smart and understands concepts (i.e. truncate v/s delete) rather than regurgitating something they may have studied up on before the interview or can find in a manual with a few minutes worth of effort. Many commands are a click away by doing them in SqlManager, and then creating a script (which is a better practice anyway, scripts are repeatable, clicking is not.) If someone in an interview can't answer a question, the correct follow up is 'how would you find out how to do it' or 'where would you get that information' or 'have you ever needed to know something like that'. The answers to those questions are often more telling than how many ways SQLServer can format a date. | |
| Thursday, March 17, 2011 - 1:22:06 PM - Jeremy Kadlec | Read The Tip |
|
John,
Thank you for the feedback. The original request for these tips were to give interviewers and interviewees a sampling of technical questions based on a topic\position\level\etc.
If you are interested in submitting a tip or two on some additional interviewing aspects we would be open to the submissions.
Feel free to send me an email – jeremyk@EdgewoodSolutions.com, to discuss further.
Thank you, Jeremy Kadlec |
|
| Monday, February 13, 2012 - 10:19:17 AM - Alain Krikilion | Read The Tip |
|
> A single DELETE command could fill up the transaction log if it is small and set to full recovery mode. Also with Simple recovery mode because the delete is 1 big transaction and is logged in the transaction log before the transaction log is cleaned up after the transaction is commited (it is not cleaned up directly after the end of the transaction but on the next checkpoint).
|
|
| Monday, February 13, 2012 - 11:04:10 AM - Jeremy Kadlec | Read The Tip |
|
Alain, Great point. Let me update that question. Thank you, |
|
|
privacy | disclaimer | copyright | advertise | about authors | contribute | feedback | giveaways | user groups Some names and products listed are the registered trademarks of their respective owners. Edgewood Solutions LLC | MSSharePointTips.com | MSSQLTips.com |