Archive for April, 2008

Son of Suckerfish sticking menus in ie7

Wednesday, April 30th, 2008

I had an annoying sticking menu problem in ie7 with son of suckerfish. I made a fix by replaceing:

#nav li:hover ul, #nav li.sfhover ul {
left: auto;
}

with

/*hack for ie7 to not have menus stick*/
html>/**/body #nav li:hover ul{
left: auto;
}

#nav li.sfhover ul {
left: auto;
}

Hopefully, this helps someone.

Get MS Sql statement timing info

Thursday, April 3rd, 2008

Tho most critical to a sql statement in a particular database is its query plan, another useful nugget of info is how long it actually takes to run the query from studio. You can get studio to give you this info by adding the following line above the query.

SET STATISTICS TIME ON

SELECT this, that FROM here INNER JOIN there on here.id = there.hereid

When you execute a statement with this line above, you get more info in the messages tab that will look like the following:

SQL Server parse and compile time:
CPU time = 0 ms, elapsed time = 1 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 1 ms.

(1 row(s) affected)

SQL Server Execution Times:
CPU time = 16 ms, elapsed time = 18 ms.

More info http://msdn2.microsoft.com/en-us/library/ms190287.aspx.

Anybody know how to set it as the default whenever using Studio?

				

Useful MS Sql command for table diskspace

Thursday, April 3rd, 2008

Sometimes developers exist in a happy state of ignorance as to what is going on with their databases. Certainly, I can’t explain everything on this blog but I’ve found this statement to be useful on MS sql.

exec sp_spaceused [your table name]

This statement returns disk info about a particular table - recordcount, physical disk space taken by data and space reserved for this table’s data. It also returns similar info on indexes so that you can get an idea of how much resources they take. Its somewhat interesting to see the differences in how a simple index vs. clustered index use resources(well, if you are slightly bored).