Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
Log in  ::  Register  ::  Not logged in

Scripts by Benson Sibanda profile

   Items 1 to 4 of 4   

String Character Count

A while ago I once attended an interview where I was asked to write a short script that counts each letter of a given string.   Read more...
By Benson Sibanda 2013/04/25 | Source:
Rating: |  Discuss |   Briefcase | 1,611 reads

The joy of sp_spaceused

This script uses a cursor to loop through all tables and get the count and table sizes using sp_spaceused. It is much faster and efficient than use 'SELECT COUNT(*) FROM TABLE_NAME'.  Read more...
By Benson Sibanda 2012/06/22 | Source: | Category: sp_spaceused
Rating: |  Discuss |   Briefcase | 1,928 reads

Script to Search Through all Databases for a Table Name

This script will search the entire server and give the name and schema of the database where the table exists.  Read more...
By Benson Sibanda 2012/06/25 | Source:
Rating: |  Discuss |   Briefcase | 1,424 reads

Variable Grouping Using a Case Statement

The code below uses a CASE STATEMENT to group sales data based on date,week,month and quarter. It should be executed in AdventureWorks 2005 or 2008.  Read more...
By Benson Sibanda 2012/05/30 | Source:
Rating: |  Discuss |   Briefcase | 1,995 reads
   Items 1 to 4 of 4