SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

Scripts by Jonathan Roberts

SQLServerCentral.com profile

   Items 1 to 7 of 7   

Table Valued Function to factorize numbers up to 100 trillion

This table valued function will quickly find the prime factors of any number up to 10 trillion  Read more...
By Jonathan Roberts 2017/04/26 | Source: SQLServerCentral.com | Category: prime numbers
Rating: (not yet rated) |  Discuss |   Briefcase | 287 reads

Table Valued Function to return a range of prime numbers

A fast table valued function to generate a list of prime numbers within the range specified by the parameters.  Read more...
By Jonathan Roberts 2017/04/12 | Source: SQLServerCentral.com | Category: tally table
Rating: |  Discuss |   Briefcase | 325 reads

Truncate a table that has foreign keys referencing its columns

This stored procedure will truncate a table even when other tables have FKs referencing columns in it. It drops the Fks, truncates the table, re-creates the FKs  Read more...
By Jonathan Roberts 2017/04/14 | Source: SQLServerCentral.com | Category: truncate table
Rating: |  Discuss |   Briefcase | 578 reads

Get file sizes of database files and free space on disk

Reports on the data and log file sizes and space used within files for each database on a servers. It also includes the free space on the drive where the file is located.  Read more...
By Jonathan Roberts 2016/03/10 | Source: SQLServerCentral.com | Category: drive space
Rating: |  Discuss |   Briefcase | 3,275 reads

Function to display integer as binary string

This function converts an integer to its binary representation. e.g. 15 is converted to '00001111'  Read more...
By Jonathan Roberts 2015/04/29 | Source: SQLServerCentral.com | Category: binary string
Rating: |  Discuss |   Briefcase | 664 reads

Function to count set bits in a signed integer

This function counts the number of 1's in the binary representation of an integer.  Read more...
By Jonathan Roberts 2015/04/28 | Source: SQLServerCentral.com | Category: hamming weight
Rating: |  Discuss |   Briefcase | 434 reads
   Items 1 to 7 of 7