A simple cursor to select tables in a database by a static prefix like b_ or delete_ and by date created, so you can drop, print or index old tables.
SQL SERVER – Auto Generate Script to Delete Deprecated Fields in Current Database
I mark old columns with a dep_ prefix, then auto generate the script to delete deprecated fields and drop their constraints first. Here is the query I use.
SQL SERVER – Query to Find ByteSize of All the Tables in Database
A short query to find the ByteSize of All the Tables in a database. It sums column lengths per table from sysobjects and syscolumns, with a WITH CUBE total.
SQL SERVER – Query to Display Foreign Key Relationships and Name of the Constraint for Each Table in Database
A long query on INFORMATION_SCHEMA views that shows foreign key relationships for each table: the table, column, referenced table and the constraint name.




