Maintenance and Management

Technical Article

Comprehensive HTML Database Documentation(Revised)

  • Script

This script will document tables (including constraints and triggers, row counts, sizes on disk), views (including all used fields), stored procedures (including used fields and parameters), database users, database settings and server settings.This script has been cobbled together from several others found on this site, so they deserve the recognition, not me πŸ™‚Simply execute it […]

β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜…

You rated this post out of 5. Change rating

2005-09-16 (first published: )

373 reads

Technical Article

check rerun status of failed/cancelled jobs

  • Script

There are times when you have mulitple job failures and need to find out in a quick way which jobs/steps failed and what their rerun statuses are.Β  This script creates a stored procedure in the msdb db to help you find out the statuses of these jobs.

β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜…

You rated this post out of 5. Change rating

2004-10-12 (first published: )

144 reads

Technical Article

Report to return all foreign key information

  • Script

The purpose of this task is to generate a report showing all your foreign keys. Generally this would be consideredΒ  nothing special only that this script also returns the tables, column foreign key constraint name and the relationship properties.Here's how to do it:First of all copy the script and paste it in Query AnalyzerStep 1: […]

β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜…

5 (1)

You rated this post out of 5. Change rating

2004-07-16 (first published: )

1,004 reads

Technical Article

UPDATE STATISTICS job

  • Script

This stored precedure can be used within a scheduled job to UPDATE STATISTICS on a data during off hours.I have commented out a parameter used to limit the size of tables to UPDATE STATISTICS.Β  Script uses the Northwind database.Have a GREAT day!!

β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜…

You rated this post out of 5. Change rating

2004-07-14 (first published: )

453 reads

Technical Article

Grant Execute Permissions to All Procedures

  • Script

This procedures grants execute permissions to all the stored procedures in a database to the role/user supplied as the parameter. the default is Execute_StoredProcedure. Execute this procedure local to the database you need to grant permissions.

β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜…

You rated this post out of 5. Change rating

2004-07-22 (first published: )

340 reads

Technical Article

Get back list of failed dts packages

  • Script

This is a fairly basic script that gets back a list of steps within dts packages that failed within the last 24 hours. The reason I wrote this script, is that if you call a dts package from a dts package on another server via a scheduled job on that same server, both the package […]

β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜…

You rated this post out of 5. Change rating

2004-09-13 (first published: )

129 reads

Technical Article

Yet another restore script usp_restore

  • Script

usp_restore - This will restore a backup performed with SQL LiteSpeed from DBAssocatesIT or by the standard backup database routines in SQL Server Please check below the declarations to find the user settable options for this script If the target database is currently in a loading status or cannot be read from this restore it […]

β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜…

You rated this post out of 5. Change rating

2004-10-25 (first published: )

611 reads

Technical Article

yet another backup script using litespeed or native backup

  • Script

Updated! Now supports both SQL Litespeed and native backup commands in one script! Several new bug fixes please see the header of the script. Error messages to add are now at the bottom of the script! This stored procedure will backup a single database or all databases it will also perform ether a full, diff, […]

β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜…

You rated this post out of 5. Change rating

2004-10-26 (first published: )

984 reads

Blogs

How to find free space in Azure PosgreSQL

By

I wanted to figure out how big (or approximately how big) my dump file...

T-SQL Tuesday #180: Good enough is perfect Roundup

By

This month, IΒ promptedΒ bloggers to discuss whether good enough is perfect. Thank you to all...

Using SQL Compare with Read-only Access

By

Recently a customer asked if SQL Compare and SQL Data Compare can be used...

Read the latest Blogs

Forums

Announcing SQL Server 2025

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Announcing SQL Server 2025

Running Steve's Code

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Running Steve's Code

New SQL Server 2022 Functions

By Steve Jones - SSC Editor

Comments posted to this topic are about the item New SQL Server 2022 Functions

Visit the forum

Question of the Day

Running Steve's Code

Can you run this code in any of your SQL Server 2019 databases without error?

CREATE OR ALTER PROCEDURE [dbo].[StevesAmazingProc]
AS
    
        SELECT Consumer_ID ,
               Trend_Category ,
               Bit_Trace
        FROM    NewWorldDB.dbo.MarketTrend;
    
GO

See possible answers