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...
  • Prices in India for the New Apple MacBooks
    The prices of the new Apple MacBooks have been released in India too. Though the machines themselves will be released in India only later th...
  • How to create a very successful CBT (Computer Based Training)
    Today I'll touch upon the topic of how to create a very successful CBT (Computer Based Training) program. Usually a computer based train...
  • 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 ...
  • 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...
  • Easy tips to Working smarter and Not harder
    The old saying goes as " Working smarter is not necessarily harder ". Today I'll tell you all the secrets on how you can maste...
  • Why do you think thermal runaway reactions are dangerous on an industrial scale?
    Thermal runaway reactions are always said to be dangerous on an industrial scale since the reactions go faster in an industry where they ten...
  • Adobe Finally enters the Online Application Market
    Though a bit late - but Adobe seems to be in a state of "Better Late than Never" and has rolled out an online website at Acrobat ....
  • Winner of the HP PhotoSmart Printer Giveaway
    Well, folks - it wasn't that easy to choose a winner. There were 340 correct / qualifying entries to the contest. That was a bit too les...

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