there is always something to develop
How to test field existance in a particular table
If You want to alter table and add column unless it already exists You just need to check then INFORMATION_SCHEMA.COLUMNS view. For example:
if not exists ( SELECT * from INFORMATION_SCHEMA.COLUMNS where table_name='Dict' and column_name='Description') begin print 'Adding field Description to Dict Table'; ALTER TABLE Dict ADD Description varchar(128) end;
See also
Comments
"Good people are good because they've come to wisdom through failure."
You are 3624 reader
since 1st April 2009
Yes | 0 | |
No | 0 |