Scripts

Technical Article

Drop and Add Foreign Keys

Have you tried using DTS to load a database and those pesky foreign keys mess you up? This is actually two scripts, one to generate the SQL needed to drop all the Foreign Keys in a database and another to Add the Foreign Keys back when you are done. I've thrown in Disabling and Enabling […]

5 (9)

You rated this post out of 5. Change rating

2005-07-13 (first published: )

3,034 reads

Technical Article

Shrink Log file for all Databases

I use this script to shrink the log files for development databases. The intention is keep the log files as small as possible when the database is not in use. By scheduling this script I can control when it happens as oppose to using auto shrink.

1.5 (2)

You rated this post out of 5. Change rating

2005-07-08 (first published: )

2,523 reads

Technical Article

Search All Fields in db for a Specific String

forums question came up where someone needed to search every varchar/char field in the database, and find any table/field that had a specific value (ie ip address, email, servername) we all agree that a monster scan like this is bad, but bad or not, sometimes you need to do it.it returns results that look something […]

You rated this post out of 5. Change rating

2005-07-07 (first published: )

252 reads

Technical Article

Import databases using backups v 2

Import database from source server using full and transaction log backups as recorded in msdb. Use it to import one or more databases to your development environment, to test your backups regularly or to move databases to a new server. To move to a new server, take a transaction log backup and put all in […]

You rated this post out of 5. Change rating

2005-07-04 (first published: )

217 reads

Technical Article

Reindex Procedure with a Twist (or two)

We’ve all seen reindex procedures that rebuild all indexes in a database or all indexes in a database which have less than a specified ScanDensity. This one goes a few steps further. First, the DBA can specify a ScanDensity_Threshold (a min value for ScanDensity), plus a Limit (qty or %). If you specify a ScanDensity_Threshold […]

5 (1)

You rated this post out of 5. Change rating

2005-06-14 (first published: )

1,838 reads

Blogs

Spark Connect Dotnet November 2024 Where are we?

By

All Spark Connect Posts Introduction There have been quite a few changes in the last...

A New Word: Ochisia

By

ochisia – n. the fear that the role you once occupied in someone’s life...

Create a Numbers Table in Power Query

By

This is a quick blog post, mainly so I have the code available if...

Read the latest Blogs

Forums

How Do You Patch 100 Database Servers?

By Steve Jones - SSC Editor

Comments posted to this topic are about the item How Do You Patch 100...

Microsoft SQL announcements at PASS Data Community Summit 2024

By Press Release

Comments posted to this topic are about the item Microsoft SQL announcements at PASS...

How to Develop Custom T-SQL Code Snippets in Azure Data Studio

By Noman072

Comments posted to this topic are about the item How to Develop Custom T-SQL...

Visit the forum

Question of the Day

What's the Ceiling?

What do I get as the results from this code?

SELECT CEILING (999.999), CEILING (-999.999);

See possible answers