Thursday, June 11, 2015

Altering Length of a Varchar Field on Production SQL Table

If you are using MS SQL Server 2008 R2 DB Server, and needing to alter the length of a varchar on a live production table without effecting the current data.

Example:
You have a table called MyTable and have a column called MyColumn that is currently varchar with length of 500 and wish to make it length of 1000.  This table is actually a production SQL Table.


ALTER TABLE MyTable
ALTER COLUMN MyColumn VARCHAR(1000)


If you like this post and want to see more, follow me on my website www.chadcompton.com
Or if you prefer...