[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 616
  • Last Modified:

change nvarchar (50) field to (max)

how do i update the data type of a field in a production DB from nvarchar(50) to nvarchar(max)
when i try this in design view in sql 2005 i get a message that said the table needs to be dropped and re-created. this is not good.

any other options that will work on a production DB ?
0
supergirl2008
Asked:
supergirl2008
1 Solution
 
Aneesh RetnakaranDatabase AdministratorCommented:
ALTER table tableName
alter column columnName nvarchar(max)
0
 
sameer2010Commented:
This worked for me..
create table c1(a nvarchar(50));
alter table c1 alter column a nvarchar(max);

Open in new window

0
 
supergirl2008Author Commented:
strange that i got the error that the table needs to be dropped and recreated, but the change was done on the table regardless.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now