William Kossack (ko******@njc.org) writes:
I'm trying to write a program in cold fusion to check the existance of
fields and data types according to requirements
I was looking at the syscolumns table for some of this information but
I've discovered that in my playing (creating and deleting tables) thre
are multiple entries for a field that is in table that is created then
deleted then created again.
This sounds very strange. My guess is that you are joining syscolumns
with systypes incorrectly. (Those two tables are indeed a bit tricky
to match up.) Care to post a query that gives funny result?
Is this a problem? Is there a better way to get at the information ie
the table, field, and type exist in a database?
Some people tout the INFORMATION_SCHEMA views, but since they only
give a subset of the metadata information, they're pretty useless in
my opinion. They are mainly interesting if you want to write portable
meta-data queries.
There are also functions like object_id, columnproperty which can be
useful at times, but they have the drawback that they are restricted
to the current database.
--
Erland Sommarskog, SQL Server MVP,
es****@sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp