Scripts

Technical Article

sp_gen_checksum_selects

Compile in master. Set your QA output to text. When run from the db of interest it generates checksum select statements for each user table in the db composed of the PK columns and a checksum for all columns excluding text, ntext, image and sql-variant. There are no parameters. Modify for your own use. Save […]

You rated this post out of 5. Change rating

2005-12-19 (first published: )

180 reads

Technical Article

Script To Compute Checksum Of The Text Field

It is a known fact, that checksum function can not be applied to text, ntext and image fields. But sometimes it is necessary to compare whether a value in a text field has changed (although it is not guaranteed that checksum generates a unique value, but it still could be used as a good estimator). […]

You rated this post out of 5. Change rating

2005-12-16 (first published: )

1,138 reads

Technical Article

Replace Object Owner

This SP is used to identify and replace the owner of the database objects. This SP will give display object id, object name, owner id, owner name and concatenate object + owner name with brackets. SP does change the owner for the following objects. SP should available in "master" database to execute in more than […]

You rated this post out of 5. Change rating

2005-12-06 (first published: )

322 reads

Technical Article

Blocked Process script for deadlock correction

This script was created to find an application problem that was causing SQL Server blocked processes. The BlockedProcess table is created to log both the blocker and blocked processes. The sp_BlockedProcess stored procedure is created to handle the situation by: inserting all processes affected by the blocking, notifying the blocking application user, emailing the admins […]

5 (2)

You rated this post out of 5. Change rating

2005-12-01 (first published: )

4,182 reads

Technical Article

Monitor Database and Log Growth

Most DBA's would like to be notified when automatic database file growth occurs. This script will log file growth. It will not log file shrink but could be easily modifed to do so.Script does the following: 1. create tables to store server list, current & historical file sizes and actual growth for each database file […]

5 (1)

You rated this post out of 5. Change rating

2005-11-29 (first published: )

2,100 reads

Technical Article

sp_GetDirInfo

Returns information about the files in the specified directory and/or subdirectories (if requested) and the total bytes for those files. Directory names are excluded so that the total bytes can be computed using the compute clause but you can specify that they be included at the expense of no total bytes. This sp uses the […]

You rated this post out of 5. Change rating

2005-11-25 (first published: )

495 reads

Technical Article

DTS Transformation Query

To transfer all the DTS package from one SQL Server to another.Create a DTS package.Select source and destination SQL Servers Create a DataPumptaskGo to disconnected editIn the DTS Data transformation task Set a) DestinationObjectName: [msdb].[dbo].[sysdtspackages] b) SQL Statement : SELECT a.name, a.id, a.versionid, a.description, a.categoryid, a.createdate, a.owner, a.packagedata, a.owner_sid FROM msdb.dbo.sysdtspackages AS A INNER JOIN […]

You rated this post out of 5. Change rating

2005-11-24 (first published: )

452 reads

Blogs

Azure SQL offerings

By

There are three Azure SQL products with so many different deployment options, service tiers,...

T-SQL Tuesday #183 Roundup

By

I hosted this month’s T-SQL Tuesday party with my invitation asking about tracking permissions....

A Little Brainstorming with an AI

By

I was asked to do some a little thinking and brainstorming recently. Rather than...

Read the latest Blogs

Forums

MEMORYBROKER_FOR_RESERVE experience

By tony28

Hi, Does anyone have experience with MEMORYBROKER_FOR_RESERVE ? when suddenly there is somehow constantly...

Moving Database Files

By Ahr Aitch

I just learned that my database was created on my C:\ drive in the...

Migrate MSSQL to MYSQL - Different Servers

By cajun_sql

I am needing to migrate a MSSQL db to MySQL, on a different server...

Visit the forum

Question of the Day

Mixed Backups

I have a complex database with a few filegroups and files. Can I run a backup command like this? (assume file/filegroup names are valid).

BACKUP DATABASE [complex]
    FILE = N'thirdone'
 ,  FILE = N'thirdtwo'
 ,  FILEGROUP = N'second' 
 TO  DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL16.SQL2022\MSSQL\Backup\complex.bak' 
 WITH NOFORMAT, NOINIT,  NAME = N'complex-Full Database Backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 10
GO

See possible answers