Scripts

Technical Article

A more efficient ForEach routine

SQL 2000's sp_MSForEachDB and sp_MSForEachTable are useful procedures for performing operations against multiple objects; however, they aren't always extremely efficient, because internally they use cursors to do their work.These 2 sprocs, sp_ForEachDB and sp_ForEachTable, perform many of the same tasks as their Microsoft-shipped twins, but run faster because they dynamically build the SQL string without […]

5 (1)

You rated this post out of 5. Change rating

2003-08-19

2,258 reads

Technical Article

Column_Gitter Part Deux

This script is similar to Column_Gitter.  I noticed this script and wanted to present the same output without the use of cursors.  Both scripts work well and produce the same results.  This little utility comes in handy if you do a lot of SQL coding. Given a table name, it'll return four results: The names […]

You rated this post out of 5. Change rating

2003-08-14

90 reads

Technical Article

Database data dictionary

This script returns a description of the database with references to all tables in the database with keys listed. If the column description has been filled out the listing includes that text.If you want to get a report on the structure of each database, just add this script to each database, and then use a […]

You rated this post out of 5. Change rating

2003-08-14

806 reads

Technical Article

ISINTEGER function

This function is similar to the ISNUMERIC native function, but tests for a valid integer.  ISNUMERIC can return false positive results when testing for a valid integer.  For example this select returns a value of 1 (true):select isnumeric('3d8')For 6.x and 7.0, you can easily convert it to a procedure.

5 (3)

You rated this post out of 5. Change rating

2003-08-14

2,788 reads

Technical Article

List All Constraints

These four scripts list concise information about all Default, Check, Unique, Foreign Key, and Primary Key constraints for the database in which they are run.  With minor column modifications, they could easily be unioned to provide a single list. The usual caveat applies about directly accessing system tables. They may change in future versions and/or […]

You rated this post out of 5. Change rating

2003-08-14

1,091 reads

Technical Article

Script to View Server's Free HD Space

This VBScript script lets you display the available disk space in each one of your administered DB servers.You have to call it with ONE argument: the filename of an archive that contains a list of known servers over which you have administration permissions.  If you program VBScript, you can put alarms when any drive goes […]

You rated this post out of 5. Change rating

2003-08-13

418 reads

Technical Article

Column_Gitter

This little utility comes in handy if you do a lot of SQL coding. Given a table name, it'll return four results: The names of the columns, the names with their datatypes, the list of columns with each one set to an identically-named variable, and a list of variables with the same names as the […]

You rated this post out of 5. Change rating

2003-08-12

202 reads

Blogs

A New Word: Ochisia

By

ochisia – n. the fear that the role you once occupied in someone’s life...

Create a Numbers Table in Power Query

By

This is a quick blog post, mainly so I have the code available if...

Microsoft finally adds Tenant Switcher for Fabric / Power BI

By

Praise whatever deity you believe in, because it’s finally here, a tenant switcher for...

Read the latest Blogs

Forums

It's The People

By Grant Fritchey

Comments posted to this topic are about the item It's The People

To View or not to View, that is the question...

By pietlinden

I've read lots of the horror stories about nested views in databases where they're...

Grant user read-write permission to a single database

By PJ_SQL

Hello! How do I grant a user to read-write to a single database and...

Visit the forum

Question of the Day

The Density Vector

When building statistics, there is the concept of density that refers to the duplicates in a table. How is this calculated?

See possible answers