T-SQL

GetFileInfo2

  • Script

An Improved version of GetFileInfo that now includes the space utilization of each datafile.  Provides more detail per file.  Predict when your files are going to grow!! Both data and log files. This script organizes information about the database files on the server.   A cursor is used to get the information from each database.  The […]

2002-06-28

513 reads

Function to return a delimited list as a table

  • Script

This SQL2000 function accepts a delimited list of values as a string and the character you want to use as a delimiter.The function then splits these out and returns them as a table.The function assumes that the input string will contain unique integer values.Useage: -  SELECT Id FROM fnSplit('1,2,3,4' , ',')

2002-06-27

571 reads

Get File Info

  • Script

This script organizes information about the database files on the server.   A cursor is used to get the information from each database.  The information is reported in Megabytes, including the next allocation from disk.  No bells and whistles...and if I can find how dbcc showfilestats works I will add the amount of space used in […]

2002-06-24

800 reads

Time to Execute a script

  • Script

This script can be divided into two parts one at the beginning of the script and the other at the end of a script. It parses the getdate() and runs datediff to give you an easy to read info on the time taken to execute a script. It is easy to get this info from […]

2002-06-20

656 reads

sp_MSforeachtrigger-Perform action on each trigger

  • Script

This stored procedure loops through each trigger and performs an action on that trigger , like disabling or printing it. Please install this stored procedure in the MASTER database. For full usage instructions and advanced parameters please see the article about it at http://www.sqlservercentral.com/columnists/bknight/sp_msforeachworker.asp. Shortened version of the usage (there are a lot more parameters […]

2002-06-14

634 reads

sp_MSforeachfk-Perform an action on every FK

  • Script

This stored procedure loops through each user defined Foreign Key and performs an action on that FK, like disabling them or printing its name. Please install this stored procedure in the MASTER database. For full usage instructions and advanced parameters please see the article about it at http://www.sqlservercentral.com/columnists/bknight/sp_msforeachworker.asp. .Shortened version of the usage (there are […]

2002-06-14

651 reads

sp_MSforeachsproc -Perform an action on each sproc

  • Script

This stored procedure loops through each view and performs an action on that stored procedure, like printing the records or running an sp_help. Please install this stored procedure in the MASTER database. For full usage instructions and advanced parameters please see the article about it at http://www.sqlservercentral.com/columnists/bknight/sp_msforeachworker.asp.Shortened version of the usage (there are a lot […]

2002-06-14

1,351 reads

sp_MSforeachview - Perform an action on each view

  • Script

This stored procedure loops through each view and performs an action on that view, like counting or printing the records. Please install this stored procedure in the MASTER database. For full usage instructions and advanced parameters please see the article about it at http://www.sqlservercentral.com/columnists/bknight/sp_msforeachworker.asp. Shortened version of the usage (there are a lot more parameters […]

2002-06-14

1,673 reads

Blogs

Understanding Azure Geo-Redundant Storage

By

While at PASS Summit 2019, I gave a session on designing Azure Disaster Recovery...

Prompt in ADS

By

Ever since VS Code and Azure Data Studio came out, people have been asking...

When Too Much is Not a Good Thing

By

Explore how to avoid unwanted results that oft occur due to lack of attention...

Read the latest Blogs

Forums

Azure DB newbie trying to locate existing Azure DBs

By tarr94

Hello, I've been tasked with trying to learn more about existing Azure DBs that...

BAckup history not showing into MSDB

By pdsqsql

Hello, We had an strange issue that our sql server 2012 Sharepoint Databases backup...

Pivot or convert column to rows

By sqltester1

Hi All, I have table which stores all in single column, I want to...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers