In this article I will explain how to change or rename datatype of column in SQL server.
ALTER
TABLE Table_Name ALTER
COLUMN COLUMN_NAME DATATYPE
|
ALTER
TABLE emp_table ALTER
COLUMN Manager_Name nvarchar(max)
|
|
If you enjoyed this post, please support the blog below. It's FREE! Get the latest Asp.net, C#.net, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email. |
|||
Subscribe by RSS
Subscribe by Email
|
|||
|
|
Subscribe by RSS
Subscribe by Email
3 comments :
Does this work even if the column is populated with data? I dont think so. The right way to do this is to create a new aux column, copy the original data there, empty the target column with nulls, alter it, and the copy back data from aux to target.
hai suresh, what is the different between nvarchar and varchar?
@Edi Prakoso....
check this post
http://www.aspdotnet-suresh.com/2012/07/difference-between-char-varchar-and.html