SQL Server VARCHAR (10)

When specifying a table in SQL Server Management Studio 2005, if I specify VARCHAR (10) for the column, when I move away from the data type, SQL Server changes it to VARCHAR (50). I must then go back, change it back to VARCHAR (10), and then it will accept it.

I understand that there are storage and processing considerations that can make VARCHAR (10) equivalent to CHAR (10) for all purposes and tasks, but is there something I am missing? Is there enough reason that I don’t consider that the default behavior of the designer is to automatically change the length of the column from what I specified?

+5
source share
6 answers

, SSMS, . .

+9

, .

+4

. create . .

+2

, , . Management Studio 2008.

, UDT (User-Defined Type) varchar(10):

create type dbo.MyChar from varchar(10) not null
0

Toad SQL Server, .

0

This is a mistake in ssms 2008 when you go somewhere else without clicking on the data type, which defaults to varchar (50) .. so don’t worry and don’t need to think, just handle it carefully ..

0
source

All Articles