| View previous topic :: View next topic |
| Author |
Message |
Dolf van den Berg Guest
|
Posted: Wed Jun 28, 2006 3:40 pm Post subject: Test if field in DB exsits |
|
|
Hi
Hi how can I test if a field exists in a DB. If it exists I need to execute
a query that will use the value in that field.
Thanks
Dolf |
|
| Back to top |
|
 |
Dennis Passmore Guest
|
Posted: Wed Jun 28, 2006 3:54 pm Post subject: Re: Test if field in DB exsits |
|
|
Just execute a query using "sp_columns_ex" specifying the table and field name and it will return
all the information available about the named column. Look it up on the MsSql books online help.
Dennis Passmore
"If you cannot conceive the idea you
will never achieve the desired results" |
|
| Back to top |
|
 |
Edwin Walker Guest
|
Posted: Fri Jun 30, 2006 7:50 pm Post subject: Re: Test if field in DB exsits |
|
|
One way you can do this, and some might say that it is not the best way, do
a select on the table and then do a FindField on that field. If FindField
returns NIL then the field does not exist.
Edwin
"Dolf van den Berg" <dolf (AT) cyberserv (DOT) co.za> wrote in message
news:44a25ca7 (AT) newsgroups (DOT) borland.com...
| Quote: | Hi
Hi how can I test if a field exists in a DB. If it exists I need to
execute a query that will use the value in that field.
Thanks
Dolf
|
|
|
| Back to top |
|
 |
|