Quite often you work on databases that you didn't write. Getting up to speed on the structure of the tables and the relationships between them is not something you relish. The GUIs provided by SQL Server 2000 or 2005 don't always provide the best way, particularly with regard to complex referential integrity. I've …
Read MoreIn SQL Server 2000 you could query the sysdatabases table to find out the "status" of a database. This field was actually a bit mask and the sysdatabases table is only available in SQL Server 2005 for backwards compatability. The sysdatabases table "maps" to the sys.databases system view. The old …
Read MoreWant to know which deleted windows user accounts still have entries in the SQL Server system tables? EXEC sp_validatelogins MSDN article on sp_validatelogins.
Read MoreKnowing the row number for a row in a result set has many uses. Paging through result sets is one example. In previous versions of SQL Server getting the row number for a result set was less than straightforward, using temporary tables or incremental counts based on a hopefully unique column were common solutions. SQL …
Read MoreLooks like the SQL Server 2005 samples, stuff like AdventureWorks etc., is now hosted on CodePlex. Link to notice on Microsoft.
Read More