I want to use the same command to drop the default value from a column, both from a sql compact and sql express database.
I know this works for SQL Compact:
ALTER TABLE Person ALTER COLUMN CreatedDate DROP DEFAULT and this for SQL Express: ALTER TABLE Person DROP CONSTRAINT [DF_Person_CreatedDate].
Is there a common command that works both in SQL Compact 3.5 and SQL Express?
Apparently not, the documentation clearly shows that ALTER TABLE has completely different syntax for SQL Server and SQL Server Compact. I assume you will either have to handle this in your own program/script/whatever, or looks for a third-party tool or library that hides these differences.