开发者

Convert Column from String to Int - Alter Script MSSQL

Can you change a column from a va开发者_JAVA技巧rchar to an int.

I have a table with a zipcode column and I want the zips to be ints instead of varchars.


ALTER TABLE [TableName]
ALTER COLUMN ZipCode INT


Actually, I suggest you do NOT make that change at all. You are in a better position for future growth if you can support the alphanumeric ZIPs outside of the US, and to do that your ZIP code column should remain a varchar.

For instance, just 2 minutes ago, I received an order from:

Hever, Belgium
VLA3191
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜