USE AdventureWorks2008R2; GO CREATE VIEW EmployeeName AS SELECT h.BusinessEntityID, p.LastName, p.FirstName FROM HumanResources.Employee AS h With JOIN Person.Person AS p ON h.BusinessEntityID = p.BusinessEntityID; GO
--select from view
SELECT * from EmployeeName WITH (NOLOCK)
NOLOCK will propagate to the tables used by the view definition
No comments:
Post a Comment