Grant Fritchey lays down the law on views:
One day, it’s going to happen. I’m going to hear some crazy theory about how SQL Server works and I’m going to literally explode. Instead of some long silly rant with oddball literary & pop culture references you’ll get a screed the size of Ulysses (and about as much fun to read). However, for the moment, like Robin Williams describing a dance move, I’m going to keep it all inside. Here’s our query:
123456789 SELECT soh.SalesOrderNumber,sod.OrderQty,sod.UnitPrice,p.NameFROM Sales.SalesOrderHeader AS sohJOIN Sales.SalesOrderDetail AS sodON sod.SalesOrderID = soh.SalesOrderIDJOIN Production.Product AS pON p.ProductID = sod.ProductID;No, no where clause because we have to compare this to this, our view:
|
|
Grant used up much of his strategic reserve of GIFs in that post, so check it out.