SQL Server 2008 alter table column type

I ran into the issue twice when I tried to change table column type. I directly went to table design page and tried to change column type as I do many times on MySQL. But it didn't work on SQL Server 2008. It asked me to recreate a new table. The first time, this table has no foreign key, I deleted it and create a new one. This time I couldn't do that because it relates to another table and I shouldn't delete tables since all of them don't created by me.

Then I tried to use alter DML, it works. It seems very strange to me. Why can we use DML to change table structure other than design mode?

ALTER TABLE dbo.YourTable ALTER COLUMN YourColumnName BIT

Anyone knows answer? Please leave me a msg. Thanks.

你可能感兴趣的:(sql,sql,sql,sql,server,server,server,server,column,table,type,structure)