Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change column's type in SQL Server CE?

I would like to change the type of a table's column in a SQL Server Compact Edition database, but it seems that the statement

ALTER TABLE [table name] modify [column name] [new type]

isn't working (VS2010 gave me the error : "The ALTER TABLE SQL construct or statement is not supported.").

My original type is INT and I would like to change it to a BIGINT.

Is it completely unsupported by SQL Server CE or do I have to execute another kind of query ?

like image 210
NicoC Avatar asked Jan 14 '23 09:01

NicoC


1 Answers

You haven't stated what exactly "isn't working" means, but according to the Books Online, the syntax should be ALTER TABLE [table name] ALTER COLUMN [column name] [new type] just like any other instance of SQL Server.

You'll run into problems, however, if the data in the column isn't supported by the new data type.

like image 144
LittleBobbyTables - Au Revoir Avatar answered Jan 17 '23 03:01

LittleBobbyTables - Au Revoir