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
精彩评论