Easy API access
Monday, October 27th, 2008This site allows super easy searching thru apis for many of the major programming languagues.

This site allows super easy searching thru apis for many of the major programming languagues.
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?
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).
Joy with a sql2005 database. I was trying to do a restore operation and got an error as described above. Sql Studio was nice enough to give me the 952 error code.
Luckily I was able to find a single blog that had a single link to an msdn forum which referenced something similar.
Ok, here is the solution. . . wait for it. . . wait for it. . . drum roll. . . wait for it. . .
Just close sql studio and reopen it and it most likely should be just fine.
Yup. There you have it. The unvarnished truth.