Samples of Select Statements:
Samples of Table Variable and More
Run isql from DOS command
DBCC - Database Consistency Checker
select orderid, sum(quantity)
from [order details]
where orderid between 11000 and 11002
group by orderid
isql -UUserAcct -PPassword [-SServer] -iMyStmt.sql
//Identify Fragmentation, see how full the pages and extents in our database:
DBCC SHOWCONTIG (table_object_id, index_id).
// Use function OBJECT_ID(object_name) to get the object_id.