Scripts

Technical Article

sp_dir - Procedure to list database objects

Lists objects from database. Similar to 'dir' command from DOS πŸ™‚Typical usage sp_dir 't' 'order*', 1 Β Β Β  - returns list of all tables whose name start with 'order' plus their columns and data typessp_dir 'p' 'custom*_sp' -Β  returns list of all stored procedures whose name start with 'custom' and end up with '_sp'For list of […]

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

You rated this post out of 5. Change rating

2002-07-19

507 reads

Technical Article

Mark DTS Task As Complete

This is a VBScript that can be placed in an ActiveX Script Task.Β  The purpose of this script is to mark other tasks in the DTS package as complete before they execute.Β  In this way you can ensure a task does not execute.The Dim and Set lines give you access to the objects in the […]

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

You rated this post out of 5. Change rating

2002-07-18

258 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