Create a computed column that returns the sum total of the ItemsInStore and ItemsInWarehouse values for each row. The new column is expected to be queried heavily, and you need to be able to index the column. Which Transact-SQL statement should you use?

 Posted by Bandi on 7/30/2014 | Category: Sql Server Interview questions | Views: 1235 | Points: 40
Select from following answers:
  1. ALTER TABLE Inventory ADD TotalItems AS ItemslnStore + ItemsInWarehouse
  2. ALTER TABLE Inventory ADD TotalItems AS ItemslnStore + ItemsInWarehouse Persisted
  3. ALTER TABLE Inventory ADD TotalItems AS SUM(ItemsInStore, ItemsInWarehouse) PERSISTED
  4. ALTER TABLE Inventory ADD TotalItems AS SUM(ItemsInStore, ItemsInWarehouse)
  5. All Above

Show Correct Answer


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response