November 19, 2013 at 8:02 am
Hello Everyone
I have a rather odd kind of question that I cannot seem to find an answer in the BOL.
When, for example, there is a normal create table statement, with normal columns and data types being declared. When the data type has not length set, what will be the default length?
CREATE TABLE dbo.TableName
PersonSex char
Since there is not a length set on the char data type. What would be the default length? Would SQL user the Minimum length such as 1, or would SQL use the Maximum length?
Thank you in advance for all your comments, suggestions and assistance
Andrew SQLDBA
November 19, 2013 at 8:06 am
the default length is 1.
when you use cast or convert, the default length is 30, but for column definitions, it's a single character.
Lowell
November 19, 2013 at 8:48 am
Thanks Lowell
After posting, I went back to the BOL, and read it. It was like that one sentence was glaring out at me. 🙂
Thanks again
Andrew
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply