SQLInsider Scripts

Finding Procedures with a specified text

  • Script

This script will give the text of all the procedures with occurences of a specifc variable. Syscomments has a limitation of 4000 characters but this script overcomes that as it uses DMO. The output is generated in a text file. If you want the name of the procedure only. replace the line where it says […]

2005-03-03 (first published: )

159 reads

UDF to return Years, Months & Days between 2 dates

  • Script

There are two UDF's included here.The first one will return the number of Years, Months and Days between a Start and End date.The second one will return either Years, Months or Days which makes it much easier to include in a select.If you know of or find a better/faster way to do this, then please […]

2006-08-01 (first published: )

163 reads


  • Script

If we give SP_HELP , we'll know to which File Group the table belongs.If we give SP_HELPFILEGROUP , we'll know the logical and physical file names along with other information that belong to the given File Group. But have you ever tried that, given a file group, how to find all the tables that belong […]


131 reads


  • Script

Are you managing big databases with a lot of tables like SAP as I'm?Do you use sp_spaceused, as I'm?Do you want to know your n biggest tables as I'm?Then don't search any longer.I'm using this script every day for may maintenance jobs.I generates, like sp_spaceused, out of sysindexes the n biggest tables without any cursor, […]


291 reads

Decimal2Text Measurement Function

  • Script

This function is based on a script by Tim Dietrich (tim@timdietrich.us) named format_height.sql. His function took what he called a decimal representation of a measurement and formatted it as feet and inches. In reality the input value was just a measurement formatted to look like a decimal number but it was not a true decimal […]


66 reads


Daily Coping 10 Jul 2020


I’ve started to add a daily coping tip to the SQLServerCentral newsletter and to...

Daily Coping 9 Jul 2020


I’ve started to add a daily coping tip to the SQLServerCentral newsletter and to...

Refreshing a Power BI Dataset in Azure Data Factory


I recently needed to ensure that a Power BI imported dataset would be refreshed...

Read the latest Blogs


temp table performance in sql 2016

By rohitkocharda

HI everyone, I just restored a DB on sql2016 from sql2012. One of my...

Nearest Proximity For every record

By marty.seed

Hello! We have a query we are trying to build with a key component....

Isnull in a Where Clause

By luismarinaray

Dear friends, We used Stored Procedure on our Queries for us to get  valuee...

Visit the forum


SQL Server Q&A from the SQLServerCentral community

Get answers