Important alert: (current site time 7/15/2013 5:31:32 AM EDT)
 

All-Time Hall of Fame
Back to contest home

For code submitted August 2008
Contest Winners and Superior Code

First and Last Date of Week
I had problem in finding Week First.....
 
 
 
 
For code submitted February 2008
Contest Winners and Superior Code

find all check constraints
This SQL*Plus script runs SQL to..........
 
 
 
 
For code submitted January 2008
Contest Winners and Superior Code

Data Preparations Methods for Data Mining Process
The purpose of this small article is to introduce some basic terms......
 
 
 
 
For code submitted September 2007
Contest Winners and Superior Code

Get String Fragment (can be called repeatedly to split a string into pieces)
Using the SUBSTR and INSTR built-ins, this PL/SQL stored.............
 
 
 
 
For code submitted August 2007
Contest Winners and Superior Code

Create Calendar in T-SQL
Creates a simple calendar output (single result set) similar to the screen shot.......
 
The shortest path...
Many IT tasks can be modeled as the shortest path pattern.......
 
For code submitted March 2007
Contest Winners and Superior Code

Column Descriptions
A great way to keep track of the original intent of the developer is to add descriptions to columns of the tables in your database (see below using Enterprise Manager)...
 
 
 
 
For code submitted January 2007
Contest Winners and Superior Code

MOVE DATABASE
MOVE DATABASE FILES MDF AND LDF !!!!!
 
 
 
 
For code submitted November 2006
Contest Winners and Superior Code

Parse A Comma Delimited String Function
This Routine Returns All Of The Data From A Comma Delimited String Into A Table.
A Simple Test Is:
SELECT * FROM dbo.ParseByComma('1,2,3,4,5,6,7,8')
 
 
 
 
For code submitted September 2006
Contest Winners and Superior Code

Introduction to SQL with MS-Access
This is a comprehensive, hands-on introduction to SQL, using a modified version of the "Northwind Traders" MS-Access database...
 
log on as another user without knowing their password
This SQL*Plus script provides a means to log on as another user without having to know their password...
 
For code submitted June 2006
Contest Winners and Superior Code

Fill Times using specific interval
This piece of code can be used in any application to fill the 24 hours time combo box using specified interval. It formats the time as hour:minute...
 
ISNUMERIC is not “ALL DIGITS”
There are many cases where you need to ensure that the string data you are working with includes only numeric digits. Most Developers will use the built in ISNUMERIC function to make such a check...
 
For code submitted May 2006
Contest Winners and Superior Code

Currency Exchange rates from Central bank of Turkish Republic
Getting XML formatted currency exchange rates data from Central bank of Turkish Republic by using stored procedures and saving it for further use.
 
 
 
 
For code submitted April 2006
Contest Winners and Superior Code

A Number To Words function
Converts a numeric value to words, i.e, 123 will return ONE HUNDRED TWENTY THREE
 
T-SQL SYNTAX GUIDE
T-SQL SYNTAX GUIDE, geate guide for Programmer's who uses the query analyzer a lot. This is the fastest way to create object on SQL and modify it.
 
For code submitted March 2006
Contest Winners and Superior Code

Data Scriptor (INSERT Generator)
This script backs up all the data from your database into a SQL script.
 
 
 
 
For code submitted February 2006
Contest Winners and Superior Code

GetTableSpace
This stored procedure returns the list of tables with number of rows, data space used and index space used numbers...
 
 
 
 
For code submitted January 2006
Contest Winners and Superior Code

Business Entity Class Generator
This SP accepts a database object name (table, view) parameter and generates (C# code) custom entity class based on the object's fields...
 
 
 
 
For code submitted December 2005
Contest Winners and Superior Code

Logical Operator
How to search with only one parameter several values of a field in a table
 
 
 
 
For code submitted September 2005
Contest Winners and Superior Code

insert into one table all rows from another table (no duplicates), with one SQL statement
The example SQL and narrative illustrate how to insert into one table all rows from another table, without pulling over duplicates (including null row duplicates)...
 
 
 
 
For code submitted June 2005
Contest Winners and Superior Code

List Directories and Files using T-SQL
Hi, This is my 6th submission, "An Intro to List File and/or Folders of any machine using T-SQL Producedurs."...
 
 
 
 
For code submitted May 2005
Contest Winners and Superior Code

Send Fax With T-SQL Using MS-Word
The following example, ("Full Commented to make it understand by VB Developers"), creates a Word document and retrieves its Application object...
 
 
 
 
For code submitted April 2005
Contest Winners and Superior Code

Advanced Database Systems
Here's some grad files on advanced database systems
 
Is it a leap year?
Here are two ways to find out if a year is a leap year, via SQL*Plus:...
 
For code submitted February 2005
Contest Winners and Superior Code

N Queens problem
Purpose is to show how the N Queens problem can be solved using SQL. In addition it includes XML, XSL, and Oracle Forms program to display generated solutions.
 
 
 
 
For code submitted November 2004
Contest Winners and Superior Code

Deleting Duplicate Rows
The Purpose of this code is to delete the duplicate values occuring in a table. This code is column-oriented...
 
update one table with another table's data, with one SQL statement
Script and narrative that illustrate how to update a column (or columns) in one table with data from another table via an Update statement with a subquery (or subqueries).
 
For code submitted September 2004
Contest Winners and Superior Code

Multiple VALUES insert
Use this little trick to INSERT MULTIPLE row values instead of using multiple INSERT statements to improve performance and typing.
 
 
 
 
For code submitted July 2004
Contest Winners and Superior Code

Quick Column Find
Quickly find all tables/views that have a specific column name
 
SQL / DB Tutorial
Learn SQL the right way - Learn about referential integrity, normal forms, and joins. Very good introduction for DB newbies.
 
For code submitted May 2004
Contest Winners and Superior Code

ut_VBClassBuilder Rev 2
Creates VB style Class definitions that include manovering and saving information.
 
 
 
 
For code submitted April 2004
Contest Winners and Superior Code

Demonstrates how to join results from a Stored Procedure with a normal table output
Demonstrates how to join results from a Stored Procedure with a normal table output
 
 
 
 
For code submitted February 2004
Contest Winners and Superior Code

Find a string in Procedures, Triggers, Constraints, Defaults,Functions and Views-even between blocks
Find a string in Procedures, Triggers, Constraints, Defaults,Functions and Views-even between blocks
 
 
 
 
For code submitted January 2004
Contest Winners and Superior Code

Auto ID Generate
This is very simple personal auto ID generator procedure and return VARCHAR value but first it check existing values that u can insert in VARCHAR field of ur TABLE.
 
 
 
 
For code submitted September 2003
Contest Winners and Superior Code

Execute SQL on Multiple Tables/Columns–New feature in MS SQL SERVER 2000
The base idea of this article is to give leverage to run SQL Statement or Stored Procedure or User defined Function or set of SQL Statements
 
 
 
 
For code submitted July 2003
Contest Winners and Superior Code

Database Documentor
SQL Server database documentor. Automatically creates a MS Word documentation of your chosen database. You will need to enable Word macros, and use medium security settings.
 
 
 
 
For code submitted June 2003
Contest Winners and Superior Code

Integrated database documentation using stored procedure
This stored procedure will help you to document your database within the database. It creates/updates a table that lists all of the user tables, views and stored procedures in the database.
 
 
 
 
For code submitted May 2003
Contest Winners and Superior Code

Stored Procedures - send anonymous email over smtp
This SP sends an email over SMTP with SQL Server 2000! It need's enough rights and "CDO for Windows 2000"!
 
 
 
 
For code submitted April 2003
Contest Winners and Superior Code

Split Function
Enables SQL Server to perform the Split Function in stored procedures/views/functions
 
VFK. A View for Table Relationships; FOREIGN KEY and REFERENCED Table/Column names and its relations
Here is a Database View to see the relationships of tables. It is easy to identify the foreign/referenced table/column names and its relationships using this view.
 
For code submitted March 2003
Contest Winners and Superior Code

Create T-SQL Cursor Code For any Table
Got tired of hand coding all that T-SQL cursor code so I created this to create the shell template for me.
 
SQL Calendar (Updated)
Displays complete calendar of any given year. Updated version of original code... Easy to alter to fit your needs. Call--- Execute Calendar 2003
 
For code submitted February 2003
Contest Winners and Superior Code

SQL Server Paging
This is the code for Paging in SQL Server. ONLY uses the 2 lines of Select Statement!!!!
 
 
 
 
For code submitted December 2002
Contest Winners and Superior Code

Lie Finder database
This databse is specifically designed to keep u free from remembering nicks, IP addresses,Dates of birth,email addresses,hobbies and other information relating to ur friends.
 
xOustUsers
OustUser is a Stored Procedure that kills all of the processes for a specified database. I mainly find this useful when I have to restore a database.
 
For code submitted November 2002
Contest Winners and Superior Code

SQL reference guide v.1.02
This is a little piece of paper which I made for the classes which I teach in VB, and this reference guide has been made for use with ACCESS-databases but should work with SQL SERVER.
 
 
 
 
For code submitted October 2002
Contest Winners and Superior Code

Introduction to PL/SQL (Series 3) Cursors
PL/SQL introduces a new dimension of power programming capability for the developer.
 
 
 
 
For code submitted September 2002
Contest Winners and Superior Code

SQL CALENDAR
UPDATED:Produces Full Calendar for each Month in a Year. Just pass year as an integer. Let me know if it proves useful. Call it Like: Execute Calendar 2002
 
 
 
 
For code submitted August 2002
Contest Winners and Superior Code

dbo.DoubleMetaPhone
Creates a better phonetic matching key than Soundex.
 
 
 
 
For code submitted July 2002
Contest Winners and Superior Code

_123 TSQL functions updated 7-14-02
This is a collection of 123 TSQL functions for professional, academic or learning purposes.
 
DECRYPT SQL SERVER 2000 STORED PROCEDURES, VIEWS AND TRIGGERS (WITH EXAMPLES)
This SP will decrypt Stored Procedures, Views or Triggers that were encrypted using "with encryption"
 
For code submitted June 2002
Contest Winners and Superior Code

Procedure to Export/Import Images In/From SQL SERVER
the procedure is used as an Interface to the TextCopy Utility supplied with SQL SERVER in order to simplify handling of BLOBS (images/docs)
 
 
 
 
For code submitted May 2002
Contest Winners and Superior Code

pl/sql mega tutorial
This is a great 50 pages notes/tutorials on pl/sql blocks, exception handling, procedures, functions, triggers, packages....
 
SQL In Simple English - Part II
This article mainly deals with SQL Joins and SQL subqueries. Both of these are extremely useful SQL constructs and should be learnt by all beginners.
 
For code submitted April 2002
Contest Winners and Superior Code

Tedious queries 150
These are the worlds most tedious queries....all r solved. If you solve these queries then u will become the master of sql...
 
 
 
 
For code submitted March 2002
Contest Winners and Superior Code

SQL In Simple English - Part 1
Great article on how to do SQL-written in plain English.
 
User Defined Function Intro
Brief introduction to user defined functions with examples and benefits explained.
 
For code submitted February 2002
Contest Winners and Superior Code

Find a string in Procedures, Triggers, Constraints, Defaults, Functions, and Views
Allow users to search thru objects for a value they are looking. This may be items that touch a specific table/view or items that need to be replaced.
 
Join the results of a stored procedure in T-SQL : A Clean Sample
There may be several instances where you have to join the results of a stored procedure with another query. Here's how to do it
 
For code submitted December 2001
Contest Winners and Superior Code

nth largest/smallest from a table
To find Nth largest and Smallest 'value'(Numbers) from a Table.
 
 
 
 
For code submitted November 2001
Contest Winners and Superior Code

Read a text file into SQL SERVER
Using BULK INSERT TO READ A TEXT FILE into SQL SERVER and ELIMINATING THE USE of another text editor.
 
Using Case Statements to Empower your Betweens
To demonstrate selection queries using Case statements to adjust bewtween clauses range based on situational needs.
 
For code submitted October 2001
Contest Winners and Superior Code

Format integer strings (Function & SP)
Formats a string representing a numeric or decimal value, to an input length of 6000 characters and adds commas after every set of three numbers.
 
 
 
 
For code submitted September 2001
Contest Winners and Superior Code

Convert to Julian date
Convert to Julian date and Convert From Julian Date Functions
 
 
 
 
For code submitted July 2001
Contest Winners and Superior Code

Pivot Data based on Unknown Field Items
Pivot data on a column without knowing exactly what values exist.
 
 
 
 
For code submitted June 2001
Contest Winners and Superior Code

Spaces Used
Space Used : This script gives you all the space used by each table
 
 
 
 
For code submitted May 2001
Contest Winners and Superior Code

Use XML as a stored procedure parameter in SQL 2000!
How to simply pass the XML code itself as an ntext parameter, and just load it in as though it were a recordset.
 
 
 
 
For code submitted April 2001
Contest Winners and Superior Code

Insert Procedure Generator
Produce an "insert" procedure with full transaction and error handling by simply passing a table name to the procedure.
 
 
 
 
For code submitted March 2001
Contest Winners and Superior Code

Backup All Databases
Backup all databases on your server automatically with this script!
 
More Efficient Queries using Vitual Tables!!
Reduce your query times exponentially by using virual tables!
 
For code submitted February 2001
Contest Winners and Superior Code

RandomBetween
How to generate random numbers within a given range.
 
Script your data
This procedure generates INSERT statements using existing data from given tables that you can use to transfer the data elsewhere. Check it out!
 
spObjectPermissions
Handy stored procedure to query object permissions for specified user.
 
 
 
 
For code submitted January 2001
Contest Winners and Superior Code

Discovering a table size
This procedure helps you calculate table sizes, so you can better plan the database size.
 
sp_GrantPermissions
Grants Select, Insert, Update, Delete, and Execute permissions to all stored procedures and user defined tables and views.
 
For code submitted December 2000
Contest Winners and Superior Code

OpenRowSet w/Parameters
Steps to use parameters with the OPENROWSET function. Check it out!
 
sp_sessBCP
Bulk Copy(BCP) data out of one or all tables from a specified database and specified server to one or all tables in a database on the same or different server.
 
For code submitted November 2000
Contest Winners and Superior Code

Deeply Nested INNER joins
An example of how to handle the sometimes confusing nested INNER joins.
 
FindDupes
Learn how to detect duplicate rows in a table and provide a count of the dupes.
 
For code submitted October 2000
Contest Winners and Superior Code

Creating XML in a Stored Procedure
Use a cursor in a stored procedure to create short XML string to output rather than recordsets
 
 
 
 
For code submitted August 2000
Contest Winners and Superior Code

Connect SQL Server 7.0 to Informix
Informix and SQL Server can play nicely with each other if you know how. This tutorial shows you the way.
 
Find Column Name On SQL Server Tables
Handy code to locate that hard to find column name
 
For code submitted July 2000
Contest Winners and Superior Code

Array-like Manipulation
SQL is set oriented so programmers often have a hard time duplicating tried and true procedural algorithims. Heres some help.
 
Correlated Query Example
If you're new to SQL, correlated queries can make you scratch your head. This example eases you through it.
 
Oracle Database Standards Part 2
Serious databases require serious standards--part 2 of this 3 part tutorial gives some great tips!
 
Oracle Password Info
Everything you ever wanted to know about Oracle passwords.
 
Progress Indicator on Stored Procs
Shows a technique for returning progress completed info on a long run SP.
 
SQL Server Backup Strategy
If you wait until you lose data before you read this, you may be too late! Learn how to make the recovery process an easy one!
 
Stored Proceudre Tutorial
Create your first stored procedure with ease using this well written and easy to follow tutorial.