Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

alter column Expand / Collapse
Author
Message
Posted Friday, February 25, 2011 2:05 AM
Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Tuesday, September 2, 2014 8:08 AM
Points: 744, Visits: 1,056
Hi,

Suppose i have a Nvarchar column which as the following characteristics:

nvarchar(20)


This column as data inside it.

Some data sample are:

0012342123
345444455423452
235555222222222

If i change this column from nvarchar(20) to nvarchar(25)

1) Will the data already inside the column be changed in size because of this?
2) Will new data that i insert through apps nedd to be diferente because of the size change?


In other words, shoud i expect some kind of problems because of changing the size of this column?

Post #1069455
Posted Friday, February 25, 2011 2:09 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Friday, May 30, 2014 6:27 PM
Points: 2,808, Visits: 7,175
As you are using a varchar it changing the size will not make a difference as the size used is variable depending on the data.

The storage size is the length of the data + 2 bytes

I would question the need to use a unicode datatype though going by the sample data you provided.
Post #1069456
Posted Friday, February 25, 2011 2:12 AM
Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Tuesday, September 2, 2014 8:08 AM
Points: 744, Visits: 1,056
I question too...

It was not my decision. It was a decision from other person...

I think that varchar is good, no need to have unicode columns in my case (nvarchar)
Post #1069458
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse