Maintenance and Management

Technical Article

Constraint Generator

  • Script

This script can be used for generating the sql script for the constraints available on a particular table. There is a provision to generate script if the specified field(s) are part of the constraint.While specifing the field name , delimit them with ';'. Usage is ;Use pubs-- for generating the script for the tableexec Pre_Porting […]

You rated this post out of 5. Change rating

2002-08-16

431 reads

Technical Article

Script to montior ErrorLogs every 3 hours.

  • Script

This script monitors your errorlogs every 3 hours for the past 3 hours. It notifies you by email for all types of errors and by pager for all critical errors with severity type > 16. Saves lot of time when you have to monitor several servers every day 24x7. Run this script on a dedicated […]

1 (1)

You rated this post out of 5. Change rating

2002-08-09

1,187 reads

Technical Article

Change DTS package owner

  • Script

There is a un-documented stored procedure in msdb called sp_reassign_dtspackageowner. Unfortunately, this requires a package name and will only work on one at a time.  If one developer is taking over for another, it may be helpful to change all of Bob's dts packages over to Jim.   The following procedure will do just that.Not sure […]

5 (1)

You rated this post out of 5. Change rating

2002-08-05

449 reads

Technical Article

Part I: Table Size Estimation

  • Script

This script will provide the first four values required for estimating the size of a database table.  It will satisfy steps one and two in MS estimation process for the amount of space required to store the data in a MS SQL Server v7.0 or v2000 table:1    Specify the number of rows present in the […]

You rated this post out of 5. Change rating

2002-07-19

497 reads

Technical Article

sp_RemoveLogin

  • Script

Ever have trouble removing logins because of onwership issues and permission grants? This stored procedure checks for a login (sql or nt) on the local server and if found it then checks each database for ownership issues and granted permissions. The rules for action taken are listed in the header of the stored procedure. Works […]

5 (1)

You rated this post out of 5. Change rating

2005-06-14 (first published: )

969 reads

Technical Article

A new version of RowCount

  • Script

Hello,Here is a (another one, but improved) stored procedure that returns rowcounts for all tables in the current database, or only for @tablename, if provided. Output can be ordered by name or by number of rows.Improvement : Rowcount is right aligned and formatted with thousand separator.To use it : - open a connection on your […]

You rated this post out of 5. Change rating

2002-07-11

306 reads

Technical Article

Find Duplicated rows

  • Script

This is a very simple and small stored procedure which will help you identify repeated rows on any given table.  This is specially useful for situations when you want to clean up a table and add a primary key on it, but you cannot until all duplication is eliminated.  Only two parameter are necessary; table […]

You rated this post out of 5. Change rating

2002-07-08

1,080 reads

Blogs

My 2024 in Data: Music

By

This is my last week of the year working (I guess I come back...

A New Word: Suente

By

suente– n. the state of being so familiar with someone that you can be...

Side Projects

By

Anyone (everyone?) who has ever tried to learn a programming language knows that to...

Read the latest Blogs

Forums

Timeout Error while executing a TSQL statement in Sql server Express Edition

By IT researcher

I am getting the below error when I execute a SQL command in SQL...

Timeout Error while executing a TSQL statement in Sql server Express Edition

By IT researcher

I am getting the below error when I execute a SQL command in SQL...

Sql script replace and rearrange numbers

By diegodeveloper

Hi everyone. I have this table and this information. (left side of the image)...

Visit the forum

Question of the Day

DCL

We have DDL, DML, and DCL. What is DCL used for?

See possible answers