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
"Only those who do nothing do not make mistakes."
You are 3626 reader
since 1st April 2009
Yes | 0 | |
No | 0 |