![]() ![]() ![]() Meaning that if we have one or more variable length columns then we have On the the disk the data is stored by rows and we have 2 bytes which stores the Number of variable-length columns, if we have any variable length column. If the data on the disk was CHAR or VARCHAR, then your point was relevant. In this case the data on the disk is type DATE, which mean that it is always the same on the disk and when we pull it from the disk, regardless if you convert it to VARCHAR or char after you pull the data from the disk/memory. You clearly speak about the format of the row on the disk, which is not relevant to a value on-the-fly which you use using CONVERT. > Don't forget that VARCHAR() carries an extra 2 bytes of overhead to remember the length of the data If needed then add link(s) to relevant previous threads. If you want to discuss something, then you can open new thread and configure it as a discussion instead of a question. Moreover, This thread is a question and not a discussion. > I know this question is a good 7 years old SELECT CONVERT ( CHAR ( 8 ), SomeDateColumn, 112 ) FROM dbo. I know this question is a good 7 years old but I have to ask why people are converting a known, absolute, fixed length output to VARCHAR(anything)? Don't forget that VARCHAR() carries an extra 2 bytes of overhead to remember the length of the dataĪnd that it has to calculate the length of the data, which we already know is going to be exactly "8". ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |