Miscellaneous

Technical Article

How to get last restore date and orginal DBName.

  • Script

This script will output the Orignal DB Name, Destination DB Name and Last Restore date for the databases. You get a specific database just add a where clause against the appropriate field. It makes use of the restorehistory and backupset tables in the MSDB database.

4.83 (6)

You rated this post out of 5. Change rating

2002-04-11

2,548 reads

Technical Article

Converting money to the word value.

  • Script

With this script you can supply an money value such as $12525.83 and it will return the word value "Twelve Thousand Five Hundred And Twenty-Five Dollars And Eighty-Three Cents".It is comprised of a table for Number to Name and a procedure to parse into it's piecesNOTE: This only goes to billions at this point, but […]

You rated this post out of 5. Change rating

2002-04-11

425 reads

Technical Article

Database structure queries

  • Script

Gets most important information of database structure. This includes all user tables, their fields, datatypes, defaults (including default constraint names), etc, primary keys and their fields, unique constraints and their fields, check constraints (including their conditions), foreign key constraints and their fields aswell as any other indexes and their fields. Should be quite useful for […]

5 (2)

You rated this post out of 5. Change rating

2002-04-08

3,039 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