T-SQL

Technical Article

CSV Lists of Columns in Different Formats

  • Script

This script creates comma separated lists of columns in different formats. These lists can be copied and pasted into other T-SQL statements.  The lists are formatted as: a simple list of column names, a list with the column names as declared variables (@ + column name + data type), a list with column names as […]

You rated this post out of 5. Change rating

2002-12-26

199 reads

Technical Article

To find the next available ID

  • Script

There are times when you have a limited range of ids and these have to be re-used as they become available.The script lists the first missing id in a table.Note that this script works best for a table with a limited number of rows, say sub 100,000I tested this on a PIII 500MHz 256Mb RAM […]

You rated this post out of 5. Change rating

2002-12-09

243 reads

Technical Article

Dynamic String Compare (W/O the dynamic sql)

  • Script

Purpose: To compare two strings with a supplied operator and return true if the strings evaluate to true using the operator provided. This is useful for stored procs to use instead of dynamic sql. YAY!  Allowing for the operator and value to be passed in as parms. So that the user on the front end […]

You rated this post out of 5. Change rating

2002-12-07

852 reads

Technical Article

Stored Proc with optional parameters

  • Script

Sometimes people want a Stored Proc with optional parameters. A lot of times people will use a coalesce for this. The problem with optional paremeters is that the query plan will never be an exact mach for that specific query. ( You never know what paremeters are filled..... )To solve this problem look at the […]

You rated this post out of 5. Change rating

2002-12-06

441 reads

Technical Article

Converting Binary data to a Hex Character String

  • Script

Occassionally you might want to convert a binary number into some printable string.   This would allow you display some meaning fully numbers hex characters, instead of just some unreadable garbage.  This script takes a binary field, of basically any length, and converts it, character by character, to a character string.  The character string will contain […]

You rated this post out of 5. Change rating

2002-11-07

455 reads

Technical Article

sp_DBCompare

  • Script

This simple script make a comparison between two given database. It compare: The table present in both database            The data type, lenght, nullability, precision for each table.            The object present in both database. The StoredProc is able to compare database across different server, simple make […]

You rated this post out of 5. Change rating

2002-10-31

806 reads

Technical Article

Latest DTS Package Log

  • Script

This script returns the latest package log for the DTS package specified in the @package_name variable.  The interface for viewing DTS package logs through Enterprise Manager is limited in the fact that it doesn't provide textual descriptions of the values for the Step Execute Status and Step Execute Results.  This makes it difficult to trace […]

You rated this post out of 5. Change rating

2002-10-22

619 reads

Blogs

Why use XACT_ABORT?

By

This came up one day at my work when a developer was using it....

Using AI for Data Conversion

By

I’m sure I’ve never mentioned that I’m an amateur radio operator. Like Vegans and...

Advice I Like: Tipping

By

When in doubt, overtip – from Excellent Advice for Living This is close to...

Read the latest Blogs

Forums

Installing SQL Instance on a Clustered Virtual Disk

By bokswager

Hi Everyone, I have a question, I am trying to setup a Lab environment...

Upgrades to SQL Server 2022

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Upgrades to SQL Server 2022

Elements of the SQL Server Update Statement

By Kenneth Igiri

Comments posted to this topic are about the item Elements of the SQL Server...

Visit the forum

Question of the Day

Upgrades to SQL Server 2022

What is the earliest version from which you can directly upgrade to SQL Server 2022?

See possible answers