Re: Change Data Type

From: Russell Fields (RussellFields_at_NoMailPlease.Com)
Date: 05/06/04


Date: Thu, 6 May 2004 16:44:59 -0400

Paul,

The issues with varchar and nvarchar are fairly straight-forward, however
ALTER TABLE cannot change texts and ntexts. I understand that you must drop
any indexes on a varchar that you are changing to nvarchar before doing the
alter. One of the other main restrictions is that the data must all fit
into the new target. The BOL explains most of this in the ALTER TABLE
topic.

You might also find the following article from SQL Server magazine helpful.

http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/dnsqlmag04/html/InsideALTERTABLE.asp

Russell Fields

"Paul" <paul@gotheta.com> wrote in message
news:uJjE5d6MEHA.1340@TK2MSFTNGP12.phx.gbl...
> Hi,
> I am not sure if I am posting to the correct group, but I am wondering if
> there are any dangers in changing datatypes on a column.
> More specifically, I want to change some varchars to nvarchars and texts
to
> ntexts. I already have the script written for the columns I need to
change.
> I have seen no issues in doing this on my test database, but I was
wondering
> if there are any inherent dangers in doing this.
> Are there any articles that can be helpful for this subject?
>
> Thank you,
> Paul
>
>



Relevant Pages

  • Re: Data Type nvarchar or varchar
    ... Access with Unicode, why would you want to start changing things now? ... Do you think can i change nvarchar to varchar without impact problems? ... can switch the data types back to varchar. ...
    (microsoft.public.access.adp.sqlserver)
  • Re: varchar and nvarchar, which one to use???
    ... > and i was confused the correct use of varchar and nvarchar. ... For a business like Amazon, the choice should be simple: ... have a customer that requires support for, say, Polish and Swedish the same ...
    (microsoft.public.sqlserver.programming)
  • varchar and nvarchar, which one to use???
    ... and i was confused the correct use of varchar and nvarchar. ... I've been using varchar in the past, but i noticed all the code samples ... what's the best practice using these data types? ... nvarchar literal together with an indexed varchar column, ...
    (microsoft.public.sqlserver.programming)
  • Re: varchar and nvarchar, which one to use???
    ... If you will only deal with the normal ascii characters ... languages and must store a character that requires two bytes to store ... and i was confused the correct use of varchar and nvarchar. ... I've been using varchar in the past, but i noticed all the code samples ...
    (microsoft.public.sqlserver.programming)
  • Re: VarChar VS. nVarChar
    ... strongly advises using the least amount of storage in a row. ... Unless I was working on a really memory constrained system I would use ... So far I have never used varchar other than when I needed the ... Go with nvarchar unless there is a real reason not to. ...
    (microsoft.public.dotnet.framework.adonet)