Mike Taulty: 44 Amazing Silverlight 2.0 Screencasts

 

  1. Silverlight – Hello World
  2. Silverlight – Anatomy of an Application
  3. Silverlight – The VS Environment
  4. Silverlight – Content Controls
  5. Silverlight – Built-In Controls
  6. Silverlight – Width, Height, Margins, Padding, Alignment
  7. Silverlight – Using a GridSplitter
  8. Silverlight – Grid Layout
  9. Silverlight – StackPanel Layout
  10. Silverlight – Canvas Layout
  11. Silverlight – Databinding UI to .NET Classes
  12. Silverlight – Simple Styles
  13. Silverlight – Custom Types in XAML
  14. Silverlight – Binding with Conversion
  15. Silverlight – List Based Data Binding
  16. Silverlight – Simple User Control
  17. Silverlight – Templating a Button
  18. Silverlight – Resources from XAP/DLL/Site Of Origin
  19. Silverlight – Animations & Storyboards
  20. Silverlight – Uploads with WebClient
  21. Silverlight – Downloads with WebClient
  22. Silverlight – Calling HTTPS Web Services
  23. Silverlight – Calling Web Services
  24. Silverlight – Making Cross Domain Requests
  25. Silverlight – Using HttpWebRequest
  26. Silverlight – File Dialogs and User Files
  27. Silverlight – Using Sockets
  28. Silverlight – Using Isolated Storage
  29. Silverlight – .NET Code Modifying HTML
  30. Silverlight – Using Isolated Storage Quotas
  31. Silverlight – Calling JavaScript from .NET
  32. Silverlight – Evaluating JavaScript from .NET Code
  33. Silverlight – Handling HTML Events in .NET Code
  34. Silverlight – Handling .NET Events in JavaScript
  35. Silverlight – Calling .NET from JavaScript
  36. Silverlight – Displaying a Custom Splash Screen
  37. Silverlight – Passing Parameters from your Web Page
  38. Silverlight – Loading Media at Runtime
  39. Silverlight – Dynamically Loading Assemblies/Code
  40. Silverlight – Reading/Writing XML
  41. Silverlight – Multiple Threads with BackgroundWorker
  42. Silverlight – Insert/Update/Delete with the DataGrid
  43. Silverlight – Getting Started with the DataGrid
  44. Silverlight – Embedding Custom Fonts

Mike Taulty: 44 Amazing Silverlight 2.0 Screencasts | Dan | Channel 9

Displaying the Sizes of Your SQL Server’s Database’s Tables

 

Determining the Space Used by a Database or a particular Table
SQL Server has a handy little system stored procedure named sp_spaceused that will return the space used by a database or by a particular table. To determine the size used by the database, simply run:

EXEC sp_spaceused [table]

Returning the Space Used for All Tables

The sp_MSforeachtable stored procedure is one of many undocumented stored procedures tucked away in the depths of SQL Server. A list of these handy stored procedures can be found at SQL Server 2000 Useful Undocumented Stored Procedures. In short, you can use sp_MSforeachtable like so:

EXEC sp_MSforeachtable @command1="command to run"

In the command to run put a ? where you want the table name to be inserted. For example, to run the sp_spaceused stored procedure for each table in the database, we’d use:

EXEC sp_MSforeachtable @command1="EXEC sp_spaceused '?'"

This will execute EXEC sp_spaceused 'TableName' for each user table in the database.

Combining Multiple Result Sets Into a Single Result Set Using Temporary Tables

CREATE PROCEDURE dbo.TableSpaceUsed
AS

-- Create the temporary table...
CREATE TABLE #tblResults
(
   [name]   nvarchar(50),
   [rows]   int,
   [reserved]   varchar(18),
   [reserved_int]   int default(0),
   [data]   varchar(18),
   [data_int]   int default(0),
   [index_size]   varchar(18),
   [index_size_int]   int default(0),
   [unused]   varchar(18),
   [unused_int]   int default(0)
)


-- Populate the temp table...
EXEC sp_MSforeachtable @command1=
         "INSERT INTO #tblResults
           ([name],[rows],[reserved],[data],[index_size],[unused])
          EXEC sp_spaceused '?'"
   
-- Strip out the " KB" portion from the fields
UPDATE #tblResults SET
   [reserved_int] = CAST(SUBSTRING([reserved], 1, 
                             CHARINDEX(' ', [reserved])) AS int),
   [data_int] = CAST(SUBSTRING([data], 1, 
                             CHARINDEX(' ', [data])) AS int),
   [index_size_int] = CAST(SUBSTRING([index_size], 1, 
                             CHARINDEX(' ', [index_size])) AS int),
   [unused_int] = CAST(SUBSTRING([unused], 1, 
                             CHARINDEX(' ', [unused])) AS int)
   
-- Return the results...
SELECT * FROM #tblResults

This stored procedure will return a single result set. The fields that end in _int are the integer representations of those fields that are returned with KB fields.

image

4GuysFromRolla.com – Displaying the Sizes of Your SQL Server’s Database’s Tables