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: )

377 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: )

463 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: )

232 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: )

206 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

334 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

161 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

277 reads

Blogs

6 Can’t-Miss Basic SQL Courses to Learn in 2024: Your Fast Track to Data Mastery

By

Ready to dive into the world of SQL? Whether you're dreaming of a lucrative...

Data-driven vs. Data-informed: Let’s Acknowledge the Truth

By

This comic was retweeted into my timeline on Twitter (I refuse to call it...

Writing Parquet Files – #SQLNewBlogger

By

Recently I’ve been looking at archiving some data at SQL Saturday, possibly querying it,...

Read the latest Blogs

Forums

Creating a CSV Parser in Apex

By rohitgupta9060@gmail.com

Comments posted to this topic are about the item Creating a CSV Parser in...

Fixing snapshot replication login error

By webrunner

Hello experts, We set up the Brent Ozar SQL Agent alerts, one of which...

is azure an option for multiple instances of dev engine and ssas?

By stan

Hi as you can see at https://www.sqlservercentral.com/forums/topic/test-sql-servers#post-4422832  we would really like multiple instances in...

Visit the forum

Question of the Day

Multiple Query Trace Flags

I want to enable two trace flags, 4199 and 4137, for a single query. How should I do this:

-- A
SELECT
  a.AddressID
, a.AddressLine1
, a.AddressLine2
, a.City
, a.StateProvinceID
, a.PostalCode
, p.FirstName
, p.LastName
FROM
  Person.Address a
  INNER JOIN person.Person AS p
    ON p.rowguid = a.rowguid
WHERE
  City           = 'SEATTLE'
  AND PostalCode = 98104
OPTION (QUERYTRACEON 4199, 4137);

-- B
SELECT
  a.AddressID
, a.AddressLine1
, a.AddressLine2
, a.City
, a.StateProvinceID
, a.PostalCode
, p.FirstName
, p.LastName
FROM
  Person.Address a
  INNER JOIN person.Person AS p
    ON p.rowguid = a.rowguid
WHERE
  City           = 'SEATTLE'
  AND PostalCode = 98104
OPTION (QUERYTRACEON 4199, QUERYTRACEON 4137);

-- C
SELECT
  a.AddressID
, a.AddressLine1
, a.AddressLine2
, a.City
, a.StateProvinceID
, a.PostalCode
, p.FirstName
, p.LastName
FROM
  Person.Address a
  INNER JOIN person.Person AS p
    ON p.rowguid = a.rowguid
WHERE
  City           = 'SEATTLE'
  AND PostalCode = 98104
OPTION (QUERYTRACEON 4199), (QUERYTRACEON 4137);

See possible answers