Scripts

Technical Article

Create Log tables and Triggers

Usually in business applications it is necessary to maintain the history of the data being modified for auditing purposes or for later analysis. Proven way to achieve this is to create a log table for each datatable with an additional column "Action" to indicate what the user has done on the data (either insert, update […]

β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜…

(6)

You rated this post out of 5. Change rating

2007-10-26 (first published: )

6,305 reads

Technical Article

Find Table Usage

Creates a printable report of all stored procedures, views, triggers and user-defined functions that reference any of the tables passed into the procedure.Wrote this to easily list items affected by table changes when working in a fast-paced development environment developing a shrink wrapped product undergoing many schema changes.Split function is listed after sp definintion

β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜…

(6)

You rated this post out of 5. Change rating

2007-10-23 (first published: )

3,337 reads

Technical Article

Find Column Name Usage

This procedure produces a formatted report to list which tables, views and table functions have a column of the specified name. This is particularly useful in systems that do not enforce referential integrity or when schema changes are being evaluated.

β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜…

(6)

You rated this post out of 5. Change rating

2007-10-22 (first published: )

4,183 reads

Technical Article

MOM 2005 Datawarehousing Catchup

I wrote this script because our MOM Datawarehousing got so damn behind.Every time the windows Scheduled task tried to run to warehouse the dataout of OnePoint, it would puke because the SQL log would fill up. Thisallows you to start so many days out and it will increment it down by the number of days […]

β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜…

You rated this post out of 5. Change rating

2007-10-18 (first published: )

1,412 reads

Technical Article

MOM SCDWgroom Enhancement

It might not be useful now, but if you ever wanted to downsize the amount of data that you keep in your datawarehouse, good luck.  This will help you do that.  This job is set to shrink it down to 120 days, but you can adjust it as you like.  Runs again in 5 day […]

β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜…

You rated this post out of 5. Change rating

2007-10-16 (first published: )

558 reads

Technical Article

Automate Scripting with SQL Scripter

SQL Scripter is an open-source console tool for generating SQL Server DDL. Written in C# using .NET 2.0, SQL Scripter provides front-ends for MSBuild, NAnt and the Windows command line. Each front end supports syntax for specifying which types of database objects to script, including all objects of a type or directly named instances.SQL Scripter […]

β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜…

(3)

You rated this post out of 5. Change rating

2007-10-12 (first published: )

6,294 reads

Blogs

T-SQL Tuesday #202 SQL Server Outage You’ll Never Forget: A Roundup

By

When I put together the invitation for T-SQL Tuesday #202, I wasn't sure what...

A Last Minute Trip to the EU

By

My life has some crazy travel stretches for sure. Between speaking, office visits, customer...

Part 3 of 3: Tuning DiskANN β€” R, Alpha, L, Beam Width, Recall and Latency

By

In Part 1, we saw how β€˜Vamana’ represents vectors as nodes, connects them with...

Read the latest Blogs

Forums

Server-Level Table sizes

By Artur Sanin

Comments posted to this topic are about the item Server-Level Table sizes

ORDER BY alias

By aniap

Comments posted to this topic are about the item ORDER BY alias

Optional Parameter Plan Optimization in SQL Server 2025: Fixing the Kitchen-Sink Search Procedure

By vgupta

Comments posted to this topic are about the item Optional Parameter Plan Optimization in...

Visit the forum

Question of the Day

ORDER BY alias

There is a table tmp_tab:

CREATE TABLE tmp_tab (
id int,
val int
);
INSERT INTO tmp_tab VALUES
(1, 1),
(2, NULL),
(3, 3),
(4, 4),
(5, 5);
You want to order the rows ids by the following expression:
Β  Β  ISNULL(val, id) + 1
Which of the following queries produces the expected ordering and why? (Select all correct)

See possible answers