Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

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

Modifying column from limited NVARCHAR to NVARCHARMAX in SQL Server 2005

I have a table in SQL Server 2005 hosted by Godaddy. When trying to modify the structure using the direct access to the table provided by Godaddy, everytime I change the data type to a column from NVARCHAR(1) to NVARCHAR(MAX) when updating it goes back to NVARCHAR(1). The table is empty. I tried by adding a new column with no success as well.
0
Ivicarp
Asked:
Ivicarp
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
can you run this
ALTER TABLE yourtable ALTER yourcolumn NVARCHAR(MAX)

Open in new window

0
 
momi_sabagCommented:
how do you know the column is still nvarchar(1)?
0
 
IvicarpAuthor Commented:
On the screen provided by Godaddy to maintain the tables after the update to the changes is done, It shows that the data type is nvarchar with a size of 1
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
udaya kumar laligondlaTechnical LeadCommented:
check if something is happeing at the Godaddy side.
or
may be your own code somewhere changing the column
or
even dropping the table and creating it again.
there is no logic in SQL that will rollback the column altered unless you do it some how.
0
 
Éric MoreauSenior .Net ConsultantCommented:
-add a new column nvarchar(max)
-copy your data from one column to the other
-delete the old column
-rename the new column
0
 
IvicarpAuthor Commented:
I found it myself, a bug in Godaddy interface perhaps?, for a MAX in a NVARCHAR column setup the size to -1 (that is "MINUS ONE").
Thanks for all the suggestions
0
 
udaya kumar laligondlaTechnical LeadCommented:
I believe my message was right ID:24125636
check if something is happeing at the Godaddy side.
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

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