Another one for you... Counting number of lines in the tables of the db, the 'selecet count(id) from table'; takes to long for large tables, is their a way to extract the data from some sort of meta data instead?
If you are not too worried about an exact count you can get this information by a query on the system tables (and you can even "freshen" that information before you start). Can't remember exactly which table, probably sysindexes - I expect its something like
SELECT I.rows, O.name FROM dbo.sysindexes I JOIN sysobjects O ON O.ID = I.ID WHERE indid = 1