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

Scripts by Rafal Skotak

SQLServerCentral.com profile

   Items 1 to 18 of 18   
 

Kill all connection to database

Procedure tries to kill all connections to the specified database.  Read more...
By Rafal Skotak 2011/03/01 | Source: SQLServerCentral.com | Category: sql server 2005
Rating: |  Discuss |   Briefcase | 3,816 reads

Compare databases structure

This procedure is supposed to compare structure (tables, procedures, triggers, foraign keys etc.) of two specified databases.  Read more...
By Rafal Skotak 2008/10/27 | Source: SQLServerCentral.com | Category: sql server 2005
Rating: |  Discuss |   Briefcase | 2,784 reads

Row count and space used for all tables in database (update)

This procedure works like the sp_spaceused procedure but this one shows statistics for all tables in the selected database or for all databases (excluding tempdb and model).   Read more...
By Rafal Skotak 2011/05/25 | Source: SQLServerCentral.com | Category: miscellaneous
Rating: |  Discuss |   Briefcase | 9,798 reads

Select from stored procedure

This terse script shows an easy (but "dirty" - so not advisable for production environments - rather for personal use) way to select data from stored procedure.  Read more...
By Rafal Skotak 2011/12/14 | Source: SQLServerCentral.com | Category: miscellaneous
Rating: |  Discuss |   Briefcase | 4,014 reads

Generating number sequences with Common Table Expressions

The script shows one of ways generating number sequence - this one uses CTE.  Read more...
By Rafal Skotak 2011/10/04 | Source: SQLServerCentral.com | Category: miscellaneous
Rating: |  Discuss |   Briefcase | 1,773 reads

Generating permutations - procedure

This procedure prepares a query for generating permutations of n-numbers set and executes it.  Read more...
By Rafal Skotak 2008/03/18 | Source: SQLServerCentral.com | Category: miscellaneous
Rating: |  Discuss |   Briefcase | 893 reads

Clear database - delete all records from a database (updated)

The procedure below deletes all records from the specified database's(except master, model, msdb and tempdb) tables (except those from the schema 'sys').  Read more...
By Rafal Skotak 2011/12/09 | Source: SQLServerCentral.com | Category: miscellaneous
Rating: |  Discuss |   Briefcase | 4,012 reads

Search for a text in all databases

This procedure searches for a specified text in all (or one selected) databases in all (or selected) tables.  Read more...
By Rafal Skotak 2011/03/02 | Source: SQLServerCentral.com | Category: sql server 2005
Rating: |  Discuss |   Briefcase | 4,724 reads

Search for a specified GUID (or its part) in all databases (updated)

This procedure searches for the specified GUID (or its part) in all (or selected one) databases  Read more...
By Rafal Skotak 2008/03/06 | Source: SQLServerCentral.com | Category: miscellaneous
Rating: |  Discuss |   Briefcase | 830 reads

Sorted views in 2005 and TOP clause

These examples show how You can circumvent the problem with not working TOP 100 PERCENT and ORDER BY in views.  Read more...
By Rafal Skotak 2008/02/22 | Source: SQLServerCentral.com | Category: miscellaneous
Rating: |  Discuss |   Briefcase | 1,246 reads

Show all database's tables' columns' collations.

Created view displays all text columns' collations in the current database with the information whether the collation is different from the database's one.  Read more...
By Rafal Skotak 2008/04/04 | Source: SQLServerCentral.com | Category: miscellaneous
Rating: |  Discuss |   Briefcase | 1,551 reads

Generating combinations 'm elements from n-element set'

This procedure generates a dataset with combinations of elements_to_select taken from number_of_values element set. It prints also the prepared query.   Read more...
By Rafal Skotak 2008/04/01 | Source: SQLServerCentral.com | Category: miscellaneous
Rating: |  Discuss |   Briefcase | 1,120 reads

Generating permutations

This script shows one on ways of generating permutations.  Read more...
By Rafal Skotak 2008/02/27 | Category: miscellaneous
Rating: |  Discuss |   Briefcase | 985 reads

Random varchars

This procedure generates a list of random varchars (8 charactes length, only letters - lower or upper case).  Read more...
By Rafal Skotak 2008/02/28 | Source: SQLServerCentral.com
Rating: |  Discuss |   Briefcase | 594 reads

Shrink all databases

Procedure changes all databases' recovery mode to simple and shrinks them all (or at least it tries to).  Read more...
By Rafal Skotak 2012/03/07 | Source: SQLServerCentral.com | Category: backup / restore
Rating: |  Discuss |   Briefcase | 3,803 reads

Db files size per directory

This procedure displays amount of disk space used by database per directories.  Read more...
By Rafal Skotak 2008/02/29 | Source: SQLServerCentral.com
Rating: |  Discuss |   Briefcase | 880 reads

Generating number sequences

Two queries below show one of many ways how You can generate a sequence of numbers.  Read more...
By Rafal Skotak 2008/01/14 | Source: SQLServerCentral.com
Rating: |  Discuss |   Briefcase | 770 reads

Days of month function

Functions return tables with days of the specified month.  Read more...
By Rafal Skotak 2008/01/14 | Source: SQLServerCentral.com
Rating: |  Discuss |   Briefcase | 858 reads
   Items 1 to 18 of 18