|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hi. I change the data type in a column (with data inside) from nvarchar(x) to
varchar(x), which to my mind should entail decreasing the table size, and what happens is the opposite. The table grows. I issue this: ALTER TABLE table_name ALTER COLUMN column_name varchar(x); Please, if anyone knows why the table grows, can you share the knowlegde? It's very important to me. Is there a way to somehow shrink it or decrease? Darek |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
What happens when you rebuild the clustered index?
-- Tom ---------------------------------------------------- Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS SQL Server MVP Toronto, ON Canada https://mvp.support.microsoft.com/profile/Tom.Moreau "Darlove" <Darlove@discussions.microsoft.com> wrote in message news:55862A5C-ACAE-47B6-8643-0247E587CE3B@microsoft.com... Hi. I change the data type in a column (with data inside) from nvarchar(x) to varchar(x), which to my mind should entail decreasing the table size, and what happens is the opposite. The table grows. I issue this: ALTER TABLE table_name ALTER COLUMN column_name varchar(x); Please, if anyone knows why the table grows, can you share the knowlegde? It's very important to me. Is there a way to somehow shrink it or decrease? Darek |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
Hi Darek
When changing column widths with ALTER TABLE, SQL Server will not reclaim the space. I blogged about it here: http://sqlblog.com/blogs/kalen_delan...aim-space.aspx -- HTH Kalen Delaney, SQL Server MVP www.InsideSQLServer.com www.SQLTuners.com "Darlove" <Darlove@discussions.microsoft.com> wrote in message news:55862A5C-ACAE-47B6-8643-0247E587CE3B@microsoft.com... > Hi. I change the data type in a column (with data inside) from nvarchar(x) > to > varchar(x), which to my mind should entail decreasing the table size, and > what happens is the opposite. The table grows. I issue this: > > ALTER TABLE table_name ALTER COLUMN column_name varchar(x); > > Please, if anyone knows why the table grows, can you share the knowlegde? > It's very important to me. Is there a way to somehow shrink it or > decrease? > > Darek |
|
![]() |
| Outils de la discussion | |
|
|