Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 30th, 2012  |  syntax: None  |  size: 0.39 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. primary key with additional data
  2. CREATE INDEX IX_Customers_RowCust
  3. ON Customers (customer_id)
  4. INCLUDE (customer_name);
  5.        
  6. CREATE VIEW vwCust WITH SCHEMABINDING AS
  7.     SELECT t.row_id, t.customer_id, c.customer_name
  8.         FROM SomeTable t
  9.             INNER JOIN Customers c
  10.                 ON t.customer_id = c.customer_id
  11. GO
  12. CREATE UNIQUE CLUSTERED INDEX vwCustRow ON vwCust (row_id)
  13. GO