Jsbi

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Thursday, 26 February 2009

SQL Server :: Why does sp_help and Design View column length have variations in results?

Posted on 23:40 by Unknown
Well, the question of Why does sp_help and Design View column length have variations in results? has been a Million Dollar question for my SQL geek friend in office. She was confronted with this issue where the column length appears differently when sp_help is used and the correct column length is visible in design view.

Being a SQL geek herself, she usually only uses command line commands (like sp_help) to get the information she needs - but this was a very hard nut for her to crack. Well, she did crack it last evening and here's the detailed explanation on why the variations appear. Hope this information is useful for others who are struck with a similar investigation.

When we use sp_help to check the properties of the table, the length of every column which is of Unicode data type (Nchar, Nvarchar, etc.) is doubled than the original column width which can be seen in design view.

For eg. If we have a column whose data type is Nvarchar(25). When we use sp_help for this table, the column length appears 50. But when we open the table in design view it shows 25.

This is because Unicode data type takes 2 bytes for storing data. And sp_help uses int to display the length of the column.

Hope that added some gyan to you too.
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Posted in microsoft, programming | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • 100+ wishes on Orkut + Facebook for your Birthday!!
    Well, first of all thanks to all those numerous mails that I received from you all yesterday - it was my birthday yesterday. Unfortunately m...
  • Comodo Firewall :: A really good one
    As internet is becoming common in our house-holds so is the virus and trojan attacks. The best way to protect yourself from the Trojan warfa...
  • Complete list of Orkut Country Specific Websites – use these when Orkut is blocked to scrap
    Orkut – the popular social networking website from the Google stable has many country specific websites. Though most of us are only aware ...
  • www.kseeb.org website is down already
    When everyone is waiting anxiously for the SSLC results we have one shocker - the website where the results are to be announced is down!! Ye...
  • The Tech Evolution : 1GB memory 20 years ago and 1GB memory now
    The Intel Museum , which is located in Santa Clara, California, USA had recently introduced several new exhibits that demonstrate the transf...
  • HP PhotoSmart Free Printer Giveaway contest - Day 3 of 7
    Well, well - Here we have the day 3 of the contest for you. There was a barrage of e-mails yesterday as to what happened to the contest ques...
  • It's been long since I wrote
    Sorry Folks, it's been quite some time since I wrote - a week to be precise. Well - here goes the lame excuse. I was busy with assemblin...
  • Can your OS make some ice-cream for you? Well, Linux can!!
    We have the OS wars raging like the Cold War down under and ready to erupt any given time. In this time, I have a question for you - Can you...
  • Get 2nd PUC results on SMS for May 2012
    The Karnataka 2nd PU results for 2012 can be checked on the internet by following :  Get 2nd PUC results on SMS for May 2012 But did you kno...
  • Now watch videos on YouTube in 720p High Definition (HD) quality for Free
    YouTube recently launched an exclusive High Definition section for the US users. Users who have access to this section can watch the videos...

Categories

  • Android
  • announcements
  • Anti-Virus
  • Asus
  • Bangalore
  • blogging
  • Contests
  • FaceBook
  • Gadgets
  • google
  • Guest Article
  • health
  • HP
  • India
  • internet
  • iPhone
  • K810i
  • linux
  • mac
  • microsoft
  • Mobile
  • MotherBoards
  • mp3
  • NetBook
  • news
  • Office
  • personal
  • photoshop
  • Portable Apps
  • Printers
  • programming
  • Quotes
  • Review
  • software
  • story
  • technology
  • Tips
  • Travel
  • videos
  • vista
  • windows
  • Windows 7
  • Windows 8
  • zune

Blog Archive

  • ►  2012 (8)
    • ►  October (2)
    • ►  May (6)
  • ►  2011 (1)
    • ►  December (1)
  • ►  2010 (22)
    • ►  July (1)
    • ►  May (16)
    • ►  April (1)
    • ►  March (2)
    • ►  February (1)
    • ►  January (1)
  • ▼  2009 (167)
    • ►  December (3)
    • ►  November (19)
    • ►  October (12)
    • ►  September (8)
    • ►  August (11)
    • ►  July (22)
    • ►  June (30)
    • ►  May (26)
    • ►  April (20)
    • ►  March (12)
    • ▼  February (4)
      • Visual Studio 2010
      • SQL Server :: Why does sp_help and Design View col...
      • How to easily install Adobe Photoshop CS4 11.0.1 U...
      • Did you know? Gmail went Down and is Up again
  • ►  2008 (102)
    • ►  December (3)
    • ►  November (1)
    • ►  October (10)
    • ►  September (17)
    • ►  August (16)
    • ►  July (5)
    • ►  June (7)
    • ►  May (10)
    • ►  April (18)
    • ►  March (15)
Powered by Blogger.

About Me

Unknown
View my complete profile