SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
Search:  
 
 

Scripts by Rafal S.

SQLServerCentral.com profile

   Items 1 to 17 of 17   
 

Compare databases structure

This procedure is supposed to compare structure (tables, procedures, triggers, foraign keys etc.) of two specified databases.  Read more...
By Rafal S. 2008/10/27 | Source: SQLServerCentral.com | Category: SQL Server 2005
Rating: |  Discuss |  Briefcase | 1,404 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 S. 2008/05/02 | Source: SQLServerCentral.com | Category: Miscellaneous
Rating: |  Discuss |  Briefcase | 8,136 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 S. 2008/04/23 | Source: SQLServerCentral.com | Category: Miscellaneous
Rating: |  Discuss |  Briefcase | 2,284 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 S. 2008/03/31 | Source: SQLServerCentral.com | Category: Miscellaneous
Rating: (not yet rated) |  Discuss |  Briefcase | 869 reads

Generating permutations - procedure

This procedure prepares a query for generating permutations of n-numbers set and executes it.  Read more...
By Rafal S. 2008/03/18 | Source: SQLServerCentral.com | Category: Miscellaneous
Rating: |  Discuss |  Briefcase | 701 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 S. 2008/04/14 | Source: SQLServerCentral.com | Category: Miscellaneous
Rating: |  Discuss |  Briefcase | 2,459 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 S. 2008/03/12 | Source: SQLServerCentral.com | Category: Miscellaneous
Rating: |  Discuss |  Briefcase | 1,566 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 S. 2008/03/06 | Source: SQLServerCentral.com | Category: Miscellaneous
Rating: |  Discuss |  Briefcase | 621 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 S. 2008/02/22 | Source: SQLServerCentral.com | Category: Miscellaneous
Rating: |  Discuss |  Briefcase | 1,074 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 S. 2008/04/04 | Source: SQLServerCentral.com | Category: Miscellaneous
Rating: |  Discuss |  Briefcase | 886 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 S. 2008/04/01 | Source: SQLServerCentral.com | Category: Miscellaneous
Rating: |  Discuss |  Briefcase | 542 reads

Generating permutations

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

Random varchars

This procedure generates a list of random varchars (8 charactes length, only letters - lower or upper case).  Read more...
By Rafal S. 2008/02/28 | Source: SQLServerCentral.com
Rating: |  Discuss |  Briefcase | 415 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 S. 2008/03/17 | Source: SQLServerCentral.com | Category: Backup / Restore
Rating: |  Discuss |  Briefcase | 2,174 reads

Db files size per directory

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

Generating number sequences

Two queries below show one of many ways how You can generate a sequence of numbers.  Read more...
Rating: |  Discuss |  Briefcase | 29 reads

Days of month function

Functions return tables with days of the specified month.  Read more...
Rating: |  Discuss |  Briefcase | 368 reads
   Items 1 to 17 of 17