Scripts

Technical Article

Easily Kill All Users In A Database

This simple script (ran from the master database) in Query Analyser removes all the requirements of collating currently connected spids to a database and the need to systematically open a cursor to kill each spid individually by simply placing the database offline, then immediately online.

2 (1)

You rated this post out of 5. Change rating

2007-03-16 (first published: )

366 reads

Technical Article

Proper Case A String Or Name

SQL 2005 user defined function to convert a string to proper case (title case).Flexible handling of delimiters and apostrophes to cater for words like "hasn't" and also names like "O'Reilly" and "d'Angelo".Mac and Mc surnames are handled generically, with some rules and exceptions which may need to be extended.  Since McIntyre and Mcintyre are both […]

5 (2)

You rated this post out of 5. Change rating

2007-03-14 (first published: )

1,803 reads

Technical Article

AUDIT WITH A TWIST

First the SP_TABLECOMPARE was used from the site and all credit must go to the author (greate script). This script is for the creation of an audit trial. It is generic and can be used on any sql database. It deals with legasy naming conventions as well. The script creates the audit tables and triggers. […]

4.25 (4)

You rated this post out of 5. Change rating

2007-03-13 (first published: )

1,336 reads

Technical Article

Script SQL Database DDL

This tool scripts out SQL Server 2000/2005 database objects to individual files in a manner which mimics Microsoft's Visual Studio for Database Professionals [aka, "Data Dude"]. These files can then be placed under proper source management control. An entire database is scripted in one call.Alternatively, it provides a way to simply document the contents of […]

2.33 (3)

You rated this post out of 5. Change rating

2007-03-12 (first published: )

2,258 reads

Technical Article

Run SQL on All servers in your inventory

There are many times you have to deploy a common code in all of your SQL Servers. I am sure there might be thousands of way to do this, but here is how I do it and it works great. Good thing is - you can either pass SQL Statement or a SQL script (in […]

5 (2)

You rated this post out of 5. Change rating

2007-03-05 (first published: )

817 reads

Technical Article

Calculating Percentage Change

To provide data analysis you may need to perform some basic trend analysis. For example, if you want to identify the percentage of change in the number of orders received from one month to the next. The challenge to providing that on the fly is the change can be either an increase or a decrease, […]

5 (1)

You rated this post out of 5. Change rating

2007-03-02 (first published: )

6,391 reads

Technical Article

Find Text in Database Objects (triggers / stored procedures)

I find myself refacoring an existing database which has some inefficient code, like cursors in stored procedures and triggers ...Wanting to figure out which objects contained this "poor" code, I made myself a little script to list all the objects which contain a search string.Just change the value that @search is set to and run […]

5 (1)

You rated this post out of 5. Change rating

2007-03-01 (first published: )

1,157 reads

Technical Article

how to start a program like Notepad.exe in a job

sometime I need to kill an program which does not continue to process data, and i sheduled a job to do that. After lots of times' try, I made it at last.This script add a shedule to the sheduled task list, one minutes later then the current system time. You can change it by edit […]

4 (1)

You rated this post out of 5. Change rating

2007-02-28 (first published: )

251 reads

Blogs

Webcast Tomorrow on SQL Server Disaster Recovery

By

Tomorrow, November 19, 2024, at 1 PM EST, I'm giving a webcast on SQL...

SQL Server Quickie #48 – Azure SQL Managed Instance

By

Today I have uploaded SQL Server Quickie #48 to YouTube. This time I’m talking...

Spark Connect Dotnet November 2024 Where are we?

By

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

Read the latest Blogs

Forums

SSMS 20.2 on Windows11 not able to connect to SQL 2005 ??

By Johan Bijnens

We still have a couple of dino's. What should I check to re-enable access...

Agent job security account

By onkarnath.tiwary

Hi All, I have few sql server agent scheduled jobs which are supposed to...

How to manage Time zone changes for countries

By gauravkumar9

Hello Everyone, I am using Microsoft SQL Azure (RTM) - 12.0.2000.8, as of October...

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