Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7514141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T00:24:25+00:00 2026-05-30T00:24:25+00:00

I want to know how SQL Server handles varchar dynamic length and storage internally.

  • 0

I want to know how SQL Server handles varchar dynamic length and storage internally.

Is there beneficial to use Varchar if i know that i have fixed length of character is coming in column ?

I know difference between CHAR and VARCHAR, but what’s best way to use in big database for database design CHAR or VARCHAR ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T00:24:27+00:00Added an answer on May 30, 2026 at 12:24 am

    CHAR allocates its size in row, VARCHAR stores real size of string (2 bytes) and then the real string, so overhead of varchar is +2 bytes, and overhead of CHAR is – its size minus real string length. If in varchar stored NULL value – its size in db is Zero.

    See Anatomy of the Record

    record header
        4 bytes long
        two bytes of record metadata (record type)
        two bytes pointing forward in the record to the NULL bitmap
    fixed length portion of the record, containing the columns storing data types that have fixed lengths (e.g. bigint, char(10), datetime)
    NULL bitmap
        two bytes for count of columns in the record
        variable number of bytes to store one bit per column in the record, regardless of whether the column is nullable or not (this is
    

    different and simpler than SQL Server 2000 which had one bit per
    nullable column only)
    this allows an optimization when reading columns that are NULL
    variable-length column offset array
    two bytes for the count of variable-length columns
    two bytes per variable length column, giving the offset to the end of the column value
    versioning tag
    this is in SQL Server 2005 only and is a 14-byte structure that contains a timestamp plus a pointer into the version store in
    tempdb

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using sql server 2005. I just want to know is there something
I am going to use SQL Server in my project, for that I want
I have a query in sql server 2008. That I want to either pass
I want to know how does the SQL Server know what @p# is in
I want to know status of every database across a SQL Server farm. I
I am using SQL Server 2008 Enterprise version. I want to know if I
I want to know SQL Server Express edition, like SQL Server 2008 Express edition,
I want to know where to see SQL Server start/stop logs for each instances
I have a table in my SQL Server DB that holds auditing information for
I have a SQL Server that holds a lot of data. An application, running

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.