Download presentation
Presentation is loading. Please wait.
Published byWhitney Chapman Modified over 8 years ago
1
Brent Ozar SQL Server Expert Quest Software SESSION CODE: DAT316
9
CREATE TRIGGER trig_addUser ON Users FOR INSERT AS DECLARE @newStatus VARCHAR(10) SELECT @newStatus = (SELECT StatusName FROM Inserted) IF @newStatus = 'INACTIVE' PRINT ‘Inactive employees can no longer be added.’ ROLLBACK
11
SELECT TOP 100 * FROM dbo.Posts WHERE OwnerUserId = 1538 SELECT TOP 100 Tags, Id FROM dbo.Posts WHERE OwnerUserId = 1538
19
DECLARE @string VARCHAR(100) SELECT @string = 'select * from authors' EXEC sp_executesql @string
20
DECLARE @string VARCHAR(100) SELECT @string = 'select * from authors’ + 'ORDER BY ' + @OrderBy EXEC sp_executesql @string
28
SELECT object_name(i.object_id ),p.rows,user_seeks,user_scans,user_lookups,user_updates,last_user_seek,last_user_scan,last_user_lookup FROM sys.indexes i INNER JOIN sys.partitions p ON i.object_id = p.object_id AND i.index_id = p.index_id LEFT OUTER JOIN sys.dm_db_index_usage_stats ius ON i.object_id = ius.object_id AND i.index_id = ius.index_id WHERE type_desc = 'HEAP' ORDER BY rows desc --http://www.brentozar.com/go/findheaps
32
Remove Indexes Add Indexes Observe
42
Required Slide Track PMs will supply the content for this slide, which will be inserted during the final scrub.
43
www.microsoft.com/teched www.microsoft.com/learning http://microsoft.com/technet http://microsoft.com/msdn
45
Sign up for Tech·Ed 2011 and save $500 starting June 8 – June 31 st http://northamerica.msteched.com/registration You can also register at the North America 2011 kiosk located at registration Join us in Atlanta next year
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.