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

Scripts by Jonathan Roberts

SQLServerCentral.com profile

   Items 1 to 8 of 8   

Disable or rebuild all nonclustered indexes on a table

Can be useful when inserting a lot of data into a table.  Read more...
By Jonathan Roberts 2019/02/26 | Source: SQLServerCentral.com | Category: indexes
Rating: |  Discuss |   Briefcase | 229 reads

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 | 297 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 | 347 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 | 593 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,318 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 | 673 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 | 443 reads
   Items 1 to 8 of 8