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.
本文讨论了在SQLServer2008中使用DML命令修改表结构时遇到的特殊情况,以及为何在设计模式外也能实现此操作的原因。
2万+

被折叠的 条评论
为什么被折叠?



