Maintenance and Management

Technical Article

Find Tables that need Statistics Update

  • Script

Indexes and table Statistics play a big role in an OLTP database for better query performance. Maintaining statistics on a weekly basis is important but a heavily updated database tables need more emphasis on Statistics and frequent updates. Instead of trying to issue “sp_updatestats” for the entire database, you can choose tables which are heavily […]

5 (1)

You rated this post out of 5. Change rating

2004-02-17

1,905 reads

Technical Article

SQL Server Log Reader

  • Script

This script outputs the data in chronological order from the current SQL Server log.Output columns are: Log Entry Time, Event Source, Log Entry Text. This data matches with the data that can be seen under the SQL Server logs view in Enterprise Manager.The script is stand alone, but could easily be parameterised to work as […]

You rated this post out of 5. Change rating

2004-02-10

866 reads

Technical Article

Global String Search & Replace In All DB Fields

  • Script

Stored procedure to search every field in the database for a string literal.  Run the stored procedure in Query analyser, which will output sql statements to do the search.  The output of these searches will be the update sql, which again should be pasted into a query analyser window.  As the stored procedures do not […]

You rated this post out of 5. Change rating

2004-02-10

253 reads

Technical Article

List User 's Permissions in Database

  • Script

Do you ever need to look for a given user's permissions for security reasons or move the permissions for that user from test environment to production? This is a script, which will generate print statements, which can be use to view/grant, the permissions of all dbo objects, which the given user has, which is not […]

You rated this post out of 5. Change rating

2004-08-16 (first published: )

608 reads

Technical Article

List User Permissions

  • Script

Do you ever need to look for a given user's permissions for security reasons or move the permissions for that user from test environment to production? This is a script, which will generate print statements, which can be use to view/grant, the permissions of all dbo objects, which the given user has, which is not […]

2 (1)

You rated this post out of 5. Change rating

2004-07-08 (first published: )

871 reads

Blogs

A New Word: Mornden

By

mornden – n. the self-container pajama universe shared by two people on a long...

SQL Training: Black Friday Deals Up to 75% Off

By

This Black Week, don't just get a discount—get ahead! Whether you're a total newbie...

How to find free space in Azure PosgreSQL

By

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

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