Monday, October 18, 2010

SQL SERVER: ALTER column datatype

Though it appears simple, often we search google or  refer to msdn for simple SQL queries.

CREATE tableA(col1 Int,col2 Varchar(100),col3 Varchar(50))
GO

To alter the datatype for col3 in tableA, we need to do the below.

ALTER tableA
ALTER col3 Varbinary(MAX) NULL
GO

No comments:

Post a Comment