Wednesday, October 20, 2010

Microsoft Sql Server - How big should your tempdb be?

For those who wonder how big their tempdb should be or maybe just wondering why their indexes stay fragmented after running some rebuild/reorganisation scripts.

The tempdb needs to be larger than the largest index.

There's also a technique called Instant data file initialization that helps the tempdb expand more rapidly.

So if you have any rules / examples about this let us know.

Thursday, October 14, 2010

Microsoft Sql Server 2005 Performance Analysis

Note: This requires both Performance Monitor and Sql Profiler.
What this is essentially targeting is I/O Temp Db and Blocking/locking issues

Performance Monitor:
These are just aimed at the tempdb.....
Otherwise would have include some Physical Disk Counters as well.

As mentioned: Both this and the sql profiler need to be put on all the servers involved

SQL Server Transactions:Free Space in tempdb
SQL Server:Access Methods\Workfiles Created /Sec
SQL Server:Access Methods\Worktables Created /Sec
SQL Server:Access Methods\Mixed Page Allocations /Sec
SQL Server:General Statistics\Temp Tables Created /Sec
SQL Server:General Statistics\Temp Tables for destruction

Sql Profiler:
Database: Filter by database id = 2 (tempdb)
Data File Auto Grow
Log File Auto Grow

Errors and warnings:
Sort Warnings
ErrorLog
EventLog
Exception

Locks:
Deadlock
Deadlock Chain
Timeout
OLEDB:
OLEDB Errors

StoredProcedures:
SP:StmtCompleted
TSQL
SQL:BatchCompleted
SQL:StmtCompleted

Looking at DMVs won't work as there are too many loads overnight.

Tom Bizannes
http://www.macroview.com.au/

Excel Addin Support about code

When doing Add-ins for Microsoft Excel, Microsoft Word, Microsoft Outlook or other Office VBA, you often want to know what your client is running.

We add an about button to the ribbon or toolbar as follows:

Public Sub SystemVersion()

    MsgBox "Version " & g_sVersion & vbNewLine & vbNewLine & _
    ThisWorkbook.Path & "\" & ThisWorkbook.Name & vbNewLine & vbNewLine & _
    "Excel Version " & Application.Version & "." & Application.Build & vbNewLine & _
    "Running on " & Application.OperatingSystem & vbNewLine & vbNewLine & _
    "MacroView Business Technology" & vbNewLine & _
    "Solutions for SharePoint and Office" & vbNewLine & _
    "http://www.macroview.com.au", vbOKCancel, g_sSystemName
   
End Sub

As you can see, this shows the excel version, the build and the version of Windows as well as the location and the add-in version. It makes diagnosing what is wrong just that little bit easier.

Excel Chart Title Positioning in Excel 2010

Positioning the Chart Title by VBA code in Excel 2010.

There are two options:
xlChartElementPositionCustom
xlChartElementPositionAutomatic

So using code:
oChart.ChartTitle.Position = xlChartElementPositionAutomatic will make it centre at the top

One interesting chart add-in we did forced the user to enter the "Source" of the data which was placed in the chart title in small font. Just one of the things we have been asked to do for consistency in formatting Excel across an organization.

Wednesday, October 13, 2010

Setting up custom themes in Microsoft Word 2007

When creating new themes in Office 2007 be aware that by default these will be saved in the User templates location, not the Workgroups template location.
Workgroup Templates should be kept for your .dotx files or .dotm files.
Also, for consistency sake, you may want to push out theme changes to the User Templates location.

To find and change the user templates location:
  • Open Microsoft Word 2007
  • Click on the big button at the top left hand corner
  • Click on the Word Options Button
  • Select Advnaced at the left hand side and scroll down to the bottom
  • Click on the File locations button
  • Double click on user templates and change this location to your desired one.


As for editing the colors and fonts, that involves having a few colors to choose from.
Most of the colours in the templates are used for standardising charts, but you have to use Microsoft Word to set/change the template locations.
Once set, you can export the registry key so that can be rolled out if required.