Scripts

Technical Article

spEasyBackup

Database backup made simple. You dont even have to pass any parameters if desired. It will all be handled for you.Capable of Net Send status notifications and writes status message to Windows event log.Side Effects:When not passing any @database params the the backup is done of the database where the proc resides. That means if […]

You rated this post out of 5. Change rating

2002-09-06

569 reads

Technical Article

Recompile all Udf's associated with a Table

When altering the structure of tables it is good practice to run SP_RECOMPILE against the table to force triggers and stored procedures to recompile. However this does not incude Udf's which also rely on the table, and this means the Udf's may fail when they are called. Run this script and supply the table name […]

You rated this post out of 5. Change rating

2002-09-05

352 reads

Technical Article

Show valuable info from sysindexes

This sp (sp_sysindexes) captures important columns from the table sysindexes and translates the numeric values into text. It shows the owner.object, the filegroup which it belongs to, the type of index, the total number of pages for tables/clustered indexes and non clustered indexes. It also shows the status, the indid and the type of object.You […]

3.5 (2)

You rated this post out of 5. Change rating

2002-09-01

3,702 reads

Technical Article

Divide big delete into several small ones

Big transactions cause the Tlog to grow.When you do a clean of a large table, the delete statement can cause a very long transactionSometimes it's necessary to prevent this.So we divide one big delete into several little ones.A table with call centre data gets +/- 1-mlj records a day. Every day we run a script […]

You rated this post out of 5. Change rating

2002-08-27

821 reads

Technical Article

Function to Return the Amount of Children in a Tree

Assuming we have the following table (that stores hierarchical data)  :CREATE TABLE [staff] (    [employee] [int] NOT NULL ,    [employee_name] [varchar] (10) NULL ,    [supervisor] [int] NULL ,     PRIMARY KEY  CLUSTERED     (        [employee]    )  ON [PRIMARY] ,     FOREIGN KEY     (        [supervisor]    ) REFERENCES [staff] (        [employee]    ))I ‘ll built a […]

You rated this post out of 5. Change rating

2002-08-23

831 reads

Technical Article

Check W2K Event log and send results to DBA

This is a simple Script that checks the W2K event log of choice and emails the results to the DBA. This script also uses the find command so you can search for strings in your event logs. It creats two scripts, the first script sp_EventlogSys runs xp_sendmail which executes the second procedure sp_EventlogSysquery and attaches […]

You rated this post out of 5. Change rating

2002-08-22

824 reads

Technical Article

SP to display locking users in tree format

This SP will give a listing of users blocking and being blocked in a tree formation (similar to explorer tree list). It uses a User defined function that recurses through the locking information gathered from sysprocesses. The listing only shows the Hostname (username) and the SPID.First create the User Defined Function (Part One) then create […]

2 (1)

You rated this post out of 5. Change rating

2002-08-19

2,129 reads

Blogs

A New Word: Lilo

By

lilo– n. a friendship that can lie dormant for years only to pick right...

Learning Database Design and Power BI Performance

By

I spend my days working on and managing SQL Server instances—working days at least,...

Free SQL Training: Dive into Databases This December!

By

Want to learn SQL and get some real practice this December? Check out the...

Read the latest Blogs

Forums

Database Archive missing FK

By abdalah.mehdoini

Bonjour à tous, je vais bientôt démarrer un projet d'archivage de données pour alléger...

SQL Server 2005 service fails to start

By iluminadajung

Hello, I’ve been trying to install Ms SQL Server 2005 for over two weeks...

How to Repair Corrupt MySQL Tables

By Nisarg Upadhyay

Comments posted to this topic are about the item How to Repair Corrupt MySQL...

Visit the forum

Question of the Day

The Funny Dynamic SQL

What happens when I run this code:

EXEC sp_executesql N'PRINT 1; GO';

See possible answers