RSS

Tag Archives: Interview Question

Collection of Interview questions on SQL Server and Business Intelligence related subjects, Microsoft

Adding a new column to an existing table??? Check the rules first

Hi All,
So, you are standing at the gates where you need to add a new COLUMN to an existing table.

Well, there are 2 cases:

  • Table is empty
  • Table contains data

If “Table is empty” then you are still in design-phase of that table. Add new column whichever the way you know :)
E.g. Using T-SQL or through design mode of table etc.

Read the rest of this entry »

 

Tags: , , , ,

What happens to IDENTITY Column Value When SQL Transaction Fails??

Hi All,

I would like to share a simple interview question. This is very simple yet many developers overlooks or not taking care of it.

Do you know what happens to identity value if transaction fails? Do you think that identity value of table is unchanged after failure?

Before looking at the solution below, try to memorize ACID properties of transaction and answer it.

Check-out the POC shown below & wobble your mind :)

Read the rest of this entry »

 

Tags: , , ,