Scripts

Technical Article

Update Foreign Key References

This script updates all foreign key references for the specified table. Useful if you need to delete a row. The follow example would update all uses of TableA.IDENTITYCOL where the value is 1 to the value of 2. Example usage: EXEC usp_updateFK 'TableA', 1, 2

You rated this post out of 5. Change rating

2001-11-03

1,453 reads

Technical Article

Query to Display Trigger Status

Ever wanted to know whether your triggers are enabled or not? The ObjectProperty command allows you to select information about the status of objects in your database, returning 1 for True and 0 for False. The example below determines whether a single trigger is disabled. SELECT ObjectProperty(object_id('Trigger_Name'), 'ExecIsTriggerDisabled') There are a number of other useful […]

5 (1)

You rated this post out of 5. Change rating

2001-10-28

1,346 reads

Technical Article

Shows Tables for a Given Database from DOS

If you are using OSQL or ISQL from DOS querys are really hard to use, because the result is to big for the screen. With this procedure, you can especify from wich column to wich column show the list of tables. For Example: proc_tables master, 3, 10 will show you only a short list of […]

You rated this post out of 5. Change rating

2001-10-28

759 reads

Technical Article

Run a Script Against All User Databases

Now you can run administrative T-SQL tasks against all your databases in one shot. Very usefull for environments that have a seperate database for each client, ASP's, etc. It's pretty straight forward and can be used for almost any task. This example Looks for a table and prints the database name and selects from the […]

You rated this post out of 5. Change rating

2001-10-21

3,120 reads

Blogs

Modifying a Trigger to Capture More Info: #SQLNewBlogger

By

I had someone ask me about using triggers to detect changes in their tables....

SQL Server Agent Jobs: Set It and Forget It?

By

Useful tips to make your jobs more stable Too many IT teams treat SQL...

From SQL Server to PostgreSQL: A Story of 5 Key SQL Differences

By

After spending decades working in SQL Server, getting familiar with PostgreSQL felt like traveling...

Read the latest Blogs

Forums

One big server with multiple instances, or multiple smaller servers...

By jasona.work

We're currently on SQL 2019 and will likely be looking to migrate to a...

Transitioning AlwaysOn Availability Group to Synchronous Commit Mode

By abdalah.mehdoini

Hello, I have a SQL Server with an AlwaysOn configuration consisting of three replicas...

CDC & Azure Managed Instances - Performance degredation

By Ant-Green

Anyone got any good advice for performance tuning CDC on a Managed Instance? We...

Visit the forum

Question of the Day

The Trigger Updated Column(s)

In a trigger, I can use UPDATE() or UPDATED_COLUMNS() to determine which columns were changed. For these functions, which one accepts a column name as a parameter?

See possible answers