Data Warehousing

Technical Article

Pagination in stored procedure

  • Script

You recently published a script showing how to do pagination (e.g. results 20 - 30 of 100) It's also possible to do it quicker and more elegantly without having to resort to building the sql string dynamically (never a good thing IMHO). You pass in 2 parameters, @PageIndex is the first record you want (so […]

4 (2)

You rated this post out of 5. Change rating

2006-05-31 (first published: )

1,264 reads

Technical Article

Generate Add Foreign Keys statements for the table

  • Script

I was going through the painfull optimization of the database of creating better clustered indexes (not the default ones on the primary key).This operation was requiring removing all foreign keys to this table and then recreation them again.I created this script to optimize this quite tidious task.

1 (1)

You rated this post out of 5. Change rating

2006-06-08 (first published: )

737 reads

Technical Article

Source system pre-integration analysis

  • Script

Initial analysis of a new source system can be quite time consuming to manually examine tables and columns to determine which even have worthwhile values in the first place. Running this script against the current database will generate useful information for all the columns of all the tables. Details include data types with varchar lengths, […]

5 (1)

You rated this post out of 5. Change rating

2005-06-07

440 reads

Technical Article

Handle Divide by Zero in SQL Reporting Services

  • Script

Out of the box, Reporting services does not handle divide by zero conditions gracefully. There are plenty of posting on how to use the IIF() function to accomplish this, with some rather horrific looking code. In order to simplify the coding process and make the resulting expressions readable by a mere mortal, I wrote the […]

4.5 (14)

You rated this post out of 5. Change rating

2006-07-28 (first published: )

3,943 reads

Technical Article

Frequency of each field in table

  • Script

This SP will generate the frequency of each occurrence in a field or for every field in a table. The syntax isexex sp_freqall , , , , for example:exec sp_freqall utems2000_2001, null,lastname, 100would return a table (with a field name and a count) for each field in the utems2000_2001 table, except the lastname field and […]

You rated this post out of 5. Change rating

2002-10-03

224 reads

Blogs

Unlock the Power of Your Data: From Basic to Advanced Data Analysis

By

Data isn't just about numbers and spreadsheets. It holds stories, patterns, and the answers...

Attacking the Weakest Link

By

When I look at a system and think about its security model, the first...

Webinar – Microsoft Fabric for Dummies

By

On Wednesday May 15th 2024 I will give a free webinar on MSSQLTips.com about...

Read the latest Blogs

Forums

What is Carisol 350mg ?

By fafawec116

Carisol 350mg is the main ingredient. Its powerful formulation, which includes the active ingredient...

The "ORDER BY" clause behavior

By Alessandro Mortola

Comments posted to this topic are about the item The "ORDER BY" clause behavior

Are IT Certifications Still Relevant?

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Are IT Certifications Still Relevant?

Visit the forum

Question of the Day

The "ORDER BY" clause behavior

Let’s consider the following script that can be executed without any error on both SQL Sever and PostgreSQL. We define the table t1 in which we insert three records:

create table t1 (id int primary key, city varchar(50));

insert into t1 values (1, 'Rome'), (2, 'New York'), (3, NULL);
If we execute the following query, how will the records be sorted in both environments?
select city

from t1

order by city;

See possible answers