Jul 21, 2010 10:30 AM
Finding all columns with missing default value
-
Like (0)
Hi folks
I have a set of tables with the same column name (say mod_ts). Some of them have a default value of "current_timestamp" (i.e. the table column mod_ts was created with clause "mod_ts timestamp not null default current_timestamp), and some do not.
How do I list out all tables that have the column mod_ts but do not have the default value of current_timestamp?
I think the following query seems to work:
select distinct table_name from _v_sys_Columns where column_name = 'MOD_TS' and column_def is null;

