Because of some historic reasons I want to be able to modify a column like:
ALTER TABLE [t] ALTER COLUMN [c] NOT NULL
Transact SQL does not allow this syntax: I think it wants data type after the column name.
Is there a way to say "Change this column to NOT NULL whatever type it is"?
Could you please help me to complete a store procedure (See code) without inquiring INFORMATION_SCHEMA?
alter table [Anomaly Entries] alter column [anomalyID] varchar(15) not null -- works
alter table [Anomaly Entries] alter column [anomalyID] not null -- does not
create proc change_to_not_null(@tn as sysname, @cn as sysname)as
exec ('alter table [' + @tn + ']alter column ' + @cn +<???> + ' NOT NULL')