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

214 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

846 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

800 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

My 2024 in Data: Music

By

This is my last week of the year working (I guess I come back...

A New Word: Suente

By

suente– n. the state of being so familiar with someone that you can be...

Side Projects

By

Anyone (everyone?) who has ever tried to learn a programming language knows that to...

Read the latest Blogs

Forums

Timeout Error while executing a TSQL statement in Sql server Express Edition

By IT researcher

I am getting the below error when I execute a SQL command in SQL...

Timeout Error while executing a TSQL statement in Sql server Express Edition

By IT researcher

I am getting the below error when I execute a SQL command in SQL...

Sql script replace and rearrange numbers

By diegodeveloper

Hi everyone. I have this table and this information. (left side of the image)...

Visit the forum

Question of the Day

DCL

We have DDL, DML, and DCL. What is DCL used for?

See possible answers