473,378 Members | 1,354 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

One column

Aside from temp table, in what circumstance one would have only one
column for a table (be it data or key)? I can't think of any case but
some of you may.
Thanks.
Jul 20 '05 #1
4 1872
Doug Baroter (qw********@boxfrog.com) writes:
Aside from temp table, in what circumstance one would have only one
column for a table (be it data or key)? I can't think of any case but
some of you may.


The system I work with have a couple of one-column one-row tables. These
tables hold next available number in series which due to business rules
must be contiguous. They are in tables of their own to avoid a hot spot
in a table; this was an issue in SQL 6.5.

We also have a one-column table that holds dates from 1980-01-01 to 2149-12-
31. If you read a book like Joe Celko's "SQL for Smarties", you will find
several solutions that are based on a table of numbers. That is, a one-
column tables with all numbers from 1 up to some limit. Both our date table
and a table of numbers are auxillary tables that makes other queries
easier to write.

--
Erland Sommarskog, SQL Server MVP, so****@algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #2
On 1 Aug 2003 21:56:54 -0700 in comp.databases.ms-sqlserver,
qw********@boxfrog.com (Doug Baroter) wrote:
Aside from temp table, in what circumstance one would have only one
column for a table (be it data or key)? I can't think of any case but
some of you may.
Thanks.


I have a few:

tblCityNoCounty - Cities with no county so the County field on a form
is conditionally required, e.g. enter "London" as the City and there's
no need to enter the county. Really should be 2 columns with country
as well as there's Londons around the world but then at the time it
was only for the UK.

tblCountry - Speaks for itself but then I could have other info on
that like dialling code, etc. At first it did but were dropped thru
lack of use.

tblSupplierFav - List of supplier PKs that will show in a supplier
form.

tblTitle - Mr, Mrs, Dr, Rev, etc.

zstblSQLReservedWord - used in a tool I wrote to scan all tables for
instances of SQL reserved words in table/column names in an Access
database prior to upsizing.

--
Ride Free (but you still have to pay for the petrol)

(replace sithlord with trevor for email)
Jul 20 '05 #3
Excellent. It seems in essence the auxillary tables serve to make
system/solution work better, they themselves are not data tables, I
use this concept as well.

I need to catch up on Joe Celko's "SQL for Smarties" after I put out
immediate fire here.

Thanks.

Erland Sommarskog <so****@algonet.se> wrote in message news:<Xn**********************@127.0.0.1>...
Doug Baroter (qw********@boxfrog.com) writes:
Aside from temp table, in what circumstance one would have only one
column for a table (be it data or key)? I can't think of any case but
some of you may.


The system I work with have a couple of one-column one-row tables. These
tables hold next available number in series which due to business rules
must be contiguous. They are in tables of their own to avoid a hot spot
in a table; this was an issue in SQL 6.5.

We also have a one-column table that holds dates from 1980-01-01 to 2149-12-
31. If you read a book like Joe Celko's "SQL for Smarties", you will find
several solutions that are based on a table of numbers. That is, a one-
column tables with all numbers from 1 up to some limit. Both our date table
and a table of numbers are auxillary tables that makes other queries
easier to write.

Jul 20 '05 #4
Thank you. What you described, in Erland Sommarskog's term, is auxillary tables.

Trevor Best <bouncer@localhost> wrote in message news:<k3********************************@4ax.com>. ..
On 1 Aug 2003 21:56:54 -0700 in comp.databases.ms-sqlserver,
qw********@boxfrog.com (Doug Baroter) wrote:
Aside from temp table, in what circumstance one would have only one
column for a table (be it data or key)? I can't think of any case but
some of you may.
Thanks.


I have a few:

tblCityNoCounty - Cities with no county so the County field on a form
is conditionally required, e.g. enter "London" as the City and there's
no need to enter the county. Really should be 2 columns with country
as well as there's Londons around the world but then at the time it
was only for the UK.

tblCountry - Speaks for itself but then I could have other info on
that like dialling code, etc. At first it did but were dropped thru
lack of use.

tblSupplierFav - List of supplier PKs that will show in a supplier
form.

tblTitle - Mr, Mrs, Dr, Rev, etc.

zstblSQLReservedWord - used in a tool I wrote to scan all tables for
instances of SQL reserved words in table/column names in an Access
database prior to upsizing.

Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: nimdez | last post by:
Hi, I am working on an existing code base in which a lot of data displayed to the user is formatted in tables. Most tables are printed row-by-row using printf() with "%s" print conversion...
4
by: perspolis | last post by:
I have 3 columns in my datatabel name Total,unit,Price. I use a column expression in my project..and in this expression i multiplied two column... for example ...
6
by: Robert Schuldenfrei | last post by:
Dear NG, After being away from C# programming for a spell, I am trying my hand at what should be a simple task. I have been hitting my head against the wall this morning. I have a simple order...
19
by: Owen T. Soroke | last post by:
Using VB.NET I have a ListView with several columns. Two columns contain integer values, while the remaining contain string values. I am confused as to how I would provide functionality to...
2
by: ricky | last post by:
Hello, If anyone could help me with this I would highly appreciate it. I've tried everything and nothing works. What I am trying to do is so damn basic and it's just frustrating that it seems...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.