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

  • Making of Vodafone ZooZoo Ads : Exclusive Images from behind the scenes
    Most of you have become fans of ZooZoo - the non-animated character created by O&M for the latest batch of Vodafone Ads. The last time ...
  • Why should NFC be switched off when not in use?
    NFC or Near Field Communication that you find in almost all modern smartphones except Apple products is a set of standards for smartphones a...
  • Google now offers you Money Saving Tips - courtesy TipJar
    Yes you heard me right - the internet behemoth that has amassed fortunes in its Internet business now offers you tips on how to save money. ...
  • 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...
  • India Catapults to the Moon with the Successful launch of the Moon Mission
    With text book precision, India's first lunar spacecraft(Chandrayaan) was launched from the India's Satish Dhawan Space Centre (spac...
  • 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...
  • 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...
  • Technology can help you take care of your elderly Parents easily!!
    With the advent of technology - it has begun to affect our lives in many facets. Now getting a Medical Alert has also become very easy and ...
  • Google's April Fools' Day Hoaxes for 2008
    Google does have a long history of April Fools' Day hoaxes, but this year there's something different: many Google offices from out...
  • Ribbon to be natively supported in Windows 7
    The people who are drafting the new user interface guidelines for Windows 7 plan to build the Ribbon , Jewel and “other new UI concepts” nat...

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