Thursday, September 28, 2006

SQL Server Reports

I wrote a SQL query the other day to determine how many rows there were in each table in my database. I now realise this information is available directly using a Management Studio Report. From SQL Server Management Studio, select the database you would like to work with from the Object Explorer. From the Database Summary page click the report button in the toolbar. There are several reports available from this drop down button but Disk Usage Report is the one we want. Then expand the Disk Space Used by Tables section and hey presto, there are the record counts and plenty more besides !

Tuesday, September 26, 2006

Additional Remote Desktop Connection

We're forever running short of our Remote Desktop Licenses on Windows Server 2003 which means only 2 people are able to connect to a server remotely. However, there is a third connection available remotely, the console itself. Launch remote desktop using the following command line to access the magic third connection !

%SystemRoot%\System32\mstsc.exe -console

It is worth pointing out that if anybody is physically logged onto the machine, it will log them out, though in the case of a remote data center this isn't a problem.

Also, to see which terminal server sessions are free/used, type the following in a command prompt

qwinsta /server:servername

Predicate Pleasure

I've been playing around with predicates in my latest developments but had been using private members to store my find criteria as demonstrated in the dinosaur example on MSDN2. However, I now realise that my preferred way to use predicates is using anonymous methods as below.

private Customer FindCustomerByName(string name)
return Customers.Find(delegate(Customer customer) { return; });

I think this is a much neater way of going about things.

Bye for now !