I\'ve got an unexpected problem. I\'m making a script to update the schema on a SQL CE database. This won\'t run:
if not exists
(
Select column_name from
I confess to not being familiar with SQL Server CE's special limitations, however, if it supports Dynamic SQL, then this should work:
Declare @sql as nvarchar(max);
Set @sql = '';
Select @sql = 'Alter table Inventory_Master_File
add TempTestField nvarchar(10) null '
from information_schema.columns
where column_name = 'TempTestField'
and table_name = 'Inventory_Master_File'
EXEC(@sql);