ReIndexing Database tables starts with a measured maintenance need. I check the workload before choosing an index operation.
SQL SERVER – Simple Example of Cursor
The simple example of cursor I have used for years: declare it, open it, fetch each Account_ID in a WHILE loop, then close and deallocate the cursor.
SQL SERVER – Cursor to Kill All Process in Database
A simple cursor to kill all process connections in one database. It reads sp_who into a temp table and runs KILL for each spid. Run it from another database.
SQL SERVER – Simple Cursor to Select Tables in Database with Static Prefix and Date Created
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.




