Alter column size mysql – ms sql

Changing column size in both MySQL and MS SQL Server. When changing from wider to narrower size data might be truncated so be aware of that.

MySQL

 ALTER TABLE workbook MODIFY  NAME VARCHAR(255)

MS SQL

ALTER TABLE workbook
ALTER COLUMN [NAME] VARCHAR(255) NULL
GO

Columns that part of primary key can’t be altered.

Leave a Comment

Your email address will not be published. Required fields are marked *