Scripts

Technical Article

Get BCP out for all tables in a DB

           The script mentioned below will export data in all tables into textfiles to a physical path on your system using BCP utility from a Database. The sql commands used in this stored procedure are BCP utility,Identity function and temporary tables.    Here you required to give 4 input parameters, they […]

You rated this post out of 5. Change rating

2002-03-15

2,134 reads

Technical Article

Script to Find Locations of Specified Column

Use this script to find tables, views, stored procedures that directly reference a column in the SELECT statement or in a join. This script will also return stored procedure and view names that have SELECT * in them when the specified column exists in the table referenced by that SELECT statement.

4 (1)

You rated this post out of 5. Change rating

2002-03-15

1,046 reads

Technical Article

Detect the Amount of Wasted Data Space in a Table for 2000

SP_WASTED_SPACE will run through each column in your database and print a report of all the character columns. It will then print a report with :* The maximum length that a column is storing* The average length of data stored in each column* The amount of wasted space in each column* Hints on how to […]

You rated this post out of 5. Change rating

2002-03-14

1,117 reads

Technical Article

Display Rows/Space Used by all user tables

This procedure will display the rows, reserved, data, index and unused space used in KB for all user tables in the database.  The idea is to call sp_spaceused repeatedly.  Limitation: certain versions of sp_spaceused will truncate the table name to 20 characters.Speed will depend on current activity level and locking in the database.  It will […]

You rated this post out of 5. Change rating

2002-03-14

395 reads

Blogs

Redgate Summit Comes to the Windy City

By

I love Chicago. I went to visit three times in 2023: a Redgate event,...

Non-Functional Requirements

By

I have found that non-functional requirements (NFRs) can be hard to define for a...

Techorama 2024 – Slides

By

You can find the slidedeck for my Techorama session “Microsoft Fabric for Dummies” on...

Read the latest Blogs

Forums

AG listener cant be removed

By ysalem

Testing with AG on Linux with Cluster=NONE. it was all going ok and as...

Remove comma inside Comma Delimited File csv in SSIS Using Script task

By hongho2

Hi, I have two tables: one for headers with 9 fields and another for...

Inserting 100K rows Performance - Baseline Performance

By MichaelT

We're trying to understand how quick new versions of SQL server can be.  Obviously...

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