Maintenance and Management

Technical Article

yet another backup script usp_backup

  • Script

I wrote this to backup to a network share you can set the backup to spool to the local disk first then it will move it to another drive or to a unc just fine. Directory to hold and move to are not optional but if you set them to the same path it won't […]

You rated this post out of 5. Change rating

2004-09-06 (first published: )

386 reads

Technical Article

Check DB into VSS

  • Script

I use this VBScript to get a DDL copy of all objects in my DB, and check them into SourceSafe if they have changed. I run it via Scheduled Tasks every night.  Make sure unauthorised users have no access to the script location, as you need to enter the VSS password in it.

You rated this post out of 5. Change rating

2004-08-04 (first published: )

465 reads

Technical Article

Generate Strong Passwords for Standard SQL Logins

  • Script

This script will generate random Strong Passwords for all Standard SQL Logins for a specified SQL Server.  It currently does ALL standard logins, including SA, so you would want to add to the WHERE clause in the SELECT_LOGINS constant if you want to limit the logins.  The password generated will be 10 - 15 characters […]

You rated this post out of 5. Change rating

2004-08-05 (first published: )

246 reads

Technical Article

Add all users to user databaes as readonly

  • Script

I am new to writing scripts so dont blast be to bad.  This is a script to make all logins of a sql server readonly users to all user databases.  Mainly after a restore from a different server. (for reporting maybe) Any methods to optimize this script are fine.

You rated this post out of 5. Change rating

2014-10-27 (first published: )

212 reads

Technical Article

Script object or user permissions

  • Script

script useful for copying permissions from one database to another like test to production.Tim Stahlhut SEE sp_helprotect for params meaning Note: If you wish to script system object permission remove 'IsMSShipped' block of code. Fixed missing code & re-formatted it to look better.

You rated this post out of 5. Change rating

2004-03-26

337 reads

Technical Article

SP to enable, disable or list all Triggers in  DB

  • Script

SQL 7.0 and 2000 modified version of Rodrigo Acosta (racosta) Argentina Script that enable,disable or list all the Triggers in the given database. If enable or disable are specified, finds all the triggers of all the tables and enable or disable them, After that, it list all the triggers with it´s current state. If List […]

You rated this post out of 5. Change rating

2004-03-19

162 reads

Technical Article

dropUnusedLogins

  • Script

For those site using SQL Server ids as opposed to Integrated security there may be instances where occasionally SQL Server logins might get 'orphaned'. That is the login is not a member of any server group that has general database access nor does that login have specific access to any particular database.  Compile this proc […]

You rated this post out of 5. Change rating

2004-03-01

278 reads

Blogs

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...

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...

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