Scripts

Technical Article

List all Databases and Last Full Backups

This script will create a procedure to list all databases on the server (except tempdb), the last time the database was backed up (database backup, not log backups), and a comment which could be customized.  For my purposes, I flag any database which hasn't been backed up in the last week.  This provides a quick […]

5 (1)

You rated this post out of 5. Change rating

2002-06-14

3,131 reads

Technical Article

Scan stored procedures in all databases

I wrote this for the developers because they were always asking me to find all of their stored procedures that did X.It scans through the syscomments text in each database looking for the requested string.  User must have read access on the syscomments and sysobjects tables in each database.

You rated this post out of 5. Change rating

2002-06-14

887 reads

Technical Article

sp_MSforeachfk-Perform an action on every FK

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 […]

You rated this post out of 5. Change rating

2002-06-14

657 reads

Technical Article

sp_MSforeachsproc -Perform an action on each sproc

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 […]

You rated this post out of 5. Change rating

2002-06-14

1,364 reads

Technical Article

sp_MSforeachtrigger-Perform action on each trigger

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 […]

You rated this post out of 5. Change rating

2002-06-14

661 reads

Technical Article

sp_MSforeachview - Perform an action on each view

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 […]

You rated this post out of 5. Change rating

2002-06-14

2,010 reads

Technical Article

System Lock Snapshot

This script captures the current system lock in a temp table, then builds a temp translation table for database and object id by iterating through all of the databases.  It then produces a report by joining the two tables.For better performance, you could make the translation table perminante and only update it when you are […]

You rated this post out of 5. Change rating

2002-06-14

573 reads

Technical Article

Trigger to replace strings in the Text field.

I was looking over internet trying to find a SP or UDFto replace string accourences in the Text fields, I didn'tfind any so I created ths trigger, may be it will be usefull as example. Be aware on the big documents it can be time consuming.All it does is replacing < and > substrings of […]

You rated this post out of 5. Change rating

2002-06-14

523 reads

Technical Article

Comma Separated List Of Field Names

Returns a single row with a single column containing a comma-separated list of the field names for a specified table. I find this very useful when doing INSERT statements where I have to list out each field being inserted. I simply bind this proc to a hotkey and use the hotkey to get the comma-separated […]

You rated this post out of 5. Change rating

2002-06-12

1,233 reads

Technical Article

Stored procedure for viewing trigger details

This is a stored procedure for viewing details of trigger. It accepts trigger name as a optional parameter. When specified, it shows details of only that trigger. If no trigger name is specified shows the details of all the triggers in that database. this SP is created in master database but can be called from […]

You rated this post out of 5. Change rating

2002-06-12

320 reads

Blogs

Microsoft Releases Windows 11 ARM ISO – A Game Changer for ARM-Powered Devices

By

Yesterday, Microsoft released the highly anticipated Windows 11 ARM ISO image, marking a major...

Building Effective Data Governance Framework: Top Areas to Focus On

By

The post Building Effective Data Governance Framework: Top Areas to Focus On appeared first...

Master the Foundational Basics

By

It tells us to take the time to master the foundational basics of whatever...

Read the latest Blogs

Forums

Linking 2 SQL Databases

By SimonLM

Hi All I am a complete novice so I apologise for any incorrect terminology....

How to write this query?

By water490

Hi everyone I have two tables storing stock prices.  Each table comes from a...

ssrs order of operation question

By stan

hi i need "sample size" in my report's 4th data region which is a...

Visit the forum

Question of the Day

The Hash Join I

What are the two inputs called to a hash join operation in SQL Server? (choose 2)

See possible answers