SQL To Check Space Taken Up By Each Table

clive SQL, Tech Tip

This SQL for use with Microsoft SQL Server is a little better than the standard EXEC sp_MSforeachtable @command1=”EXEC sp_spaceused ‘?’” SELECT t.NAME AS TableName, (sum(a.total_pages) * 8) / 1024 as TotalSpaceMB FROM sys.tables t INNER JOIN sys.indexes i ON t.OBJECT_ID = i.object_id INNER JOIN sys.partitions p ON i.object_id = p.OBJECT_ID AND i.index_id = p.index_id INNER JOIN sys.allocation_units a ON p.partition_id …

HTTPS fails on IIS7.5 after server restart

clive All, Microsoft, Tech Tip

If HTTPS fails to start correctly following a server restart, but HTTP does. Try looking at the binding on the website which https is attached to; the act of looking (and clicking ok) will be enough to get https running again temporarily. But if it fails again on reboot, look at the logs, and in particular for the code 0x8009030d in …

Office 365, Microsoft Exchange, Outlook and Android Calendar Sync

clive All, Microsoft, Tech Tip

My, this is harder than it needs to be. If you are using Office365, and have an address like clive@rectanglered.onmicrosoft.com, one of the big attractions is getting access to Microsoft Exchange’s push based shared calendar system. If you naively try to share a calendar from Office365, you will merely get a readonly copy – no use to anyone. Office365 does …

Fast SQL Server Inserting Data from .NET

clive All, ASP.Net, Development, Microsoft, Rectangle Red, Tech Tip, Uncategorized, VB.Net

Today we needed to insert a large amount (250,000 rows) of automatically generated data into a SQL Server database. Generating the data was very fast, but inserting each line with a SQL Insert statement, painfully slow, even if logging is in Simple Mode in the SQL database. So… we investigated the SQLBulkCopy function in .NET, but this is usually used …