Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2005-03-07 : 07:46:06
|
| John writes "I would like to determine whether a certain field exists in a table before running an UPDATE statement. This table is always built dynamically based on the contents of an import file which varies in format. How do I check for the existence of a certain field in a table?" |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-03-07 : 08:07:06
|
| If col_Length('TableName','ColumnName') is not null'Column exists. Do updatationelse'Column does not existMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|