THE SQL Server Blog Spot on the Web

Welcome to SQLblog.com - The SQL Server blog spot on the web Sign in | Join | Help
in Search

John Paul Cook

  • CPU benchmarking and time for an upgrade

    Is your SQL Server running slower than you’d like? Is it your SQL Server configuration or your slightly old hardware? We need to use tools to gather information.

    My subjective impression is that my 2.2 GHz laptop outperforms my 3.0 GHz overclocked desktop in CPU bound tasks. Both are quad core machines. The desktop has a first generation quad and the laptop has a second generation quad core processor. To introduce objectivity, PassMark’s Performance Test was used to benchmark the two machines.

    image

    If you look under CPU Mark, you can see that the laptop’s second generation 2.2 GHz processor significantly outperforms the desktop’s first generation 3.0 GHz processor. The point here is that stated processor speeds aren’t everything. Comparing clock speeds from one generation of processor to another or from AMD to Intel is like comparing apples to oranges. We can drill down into the processor details and see where the differences are.

    image

    If you look under Disk Mark in the first screen capture, you can see that the laptop’s SSD is rated as being faster than the desktop’s 7200 rpm hard drive. Drilling down into the details indicates that the SSD’s advantages aren’t as pronounced for sequential reads.

    image

    It’s wise to periodically benchmark hardware. At a client site a few years ago, I used Performance Test to trace a performance problem back to the hardware. Before doing extensive performance tuning of a SQL Server, make sure that the hardware isn’t the culprit. You can’t tune away hardware problems.

  • [OT] Best Christmas Gift Imaginable

    One of my friends in declining health received the best possible Christmas present – a lung transplant! I am sad for the donor’s family who has Christmas without their loved one. I am thankful to all organ donors and their families for giving life and hope to others.

  • SQL Azure, the cloud, and Comcast

    Microsoft upped the level of service for my SQL Azure account. I can think of things I’d like to do, but there isn’t any point with Comcast as my ISP. This is the problem with cloud based services – the ISP is the weak link. I can make a PowerPoint slide of a grand plan, but it is all for naught when connectivity can’t be taken for granted. My connection speed has dropped from 30++ mbps to under 5 mbps while my monthly bill has gone up. It took over half an hour of my lost time for Comcast to suggest sending out a technician. The issue was not resolved because I literally ran out of available free time to continue the discussion.

    I think cloud based solutions are great in theory, but not so great when implemented in the real world. ISPs act like utilities, but have nowhere near the level of service reliability gas and electric utilities are known for.

  • Making a poster with Microsoft Publisher

    Sometimes we have no choice but to make a physical poster instead of using a video projector. Over the weekend, I used Microsoft Publisher to make a 48”x36” color poster. I have two tips for you. First, save your final, ready to print file as a pdf. The printing companies I contacted told me they greatly preferred pdf files. If you need a pdf, you’ll have it. If you don’t need it, no harm done in creating it. Second, I found that a flat panel HDTV is a great way to proof your final draft.

    Even my 30” computer monitor was too small to really evaluate how a printed 48”x36” poster would actually look. It’s important to look at the final draft at the same scale the final printed poster will have. Using a flat panel HDTV similar in size to the final poster lets you see the entire file or almost the entire file with little to no scrolling. Because printing and mounting of large posters is expensive, you have to get it right the first time. Get a clear plastic ruler and hold it up over the ruler bar in Publisher. Change the size of the displayed file until an inch on the displayed ruler is an inch on your physical ruler. Now you know that the image you are seeing on the HDTV is the same scale as your print will be.

  • Superscripts, subscripts, special characters, and Unicode

    Office applications and SQL Server Management Studio (SSMS) handle superscripts and subscripts differently. Office apps such as Word allow you to assign font properties to make a character appear superscripted or subscripted. SSMS doesn’t support font properties, but Unicode does provide special characters for common superscripting and subscripting symbols.

    Before you get the green light to build that SQL Server database, you’ll first have to make a compelling case for it using Word or PowerPoint. You want your proposal to look slick, full of superscripts, subscript, and Greek math symbols. That’s where we’ll start. Consider the following:

    water is H20 and it boils at 100 C

    That’s not very impressive. We can subscript the 2 by selecting it and right-clicking to bring up the Font dialog box. Select Superscript or Subscript to make your formatting change.

    image       image

    Figure 1. Font dialog box in Office applications.

    If you have a lot of subscripting and superscripting to do, using the Font dialog box to do the formatting takes too long. It’s faster and simpler to use keyboard shortcuts. Highlight the character(s) of interest and use Ctrl = to subscript, Shift Ctrl = to superscript. Just so there is no confusion, = is the key on which both + and = appear. (It’s possible someone may prefer to describe Shift Ctrl = as Ctrl + using the logic that Shift = is the same thing as the + key.)

    But even with the subscripting done, we’re still not fully done. We need the degree symbol. I did a search using Unicode degree symbol as my search string and discovered that it is the Unicode character that is hexadecimal 00B0. I find that it is faster to search for the hex code using a search engine instead of bringing up the dialog box that shows all of the Unicode character set and scrolling until I see what I need.

    Once you know the hex value for the symbol you need, go to the Insert tab in Word and then select Symbol. Use the Symbol dialog box to enter the hex value for the symbol of interest.

    image

    Figure 2. Select More Symbols… to specify your symbol by its hexadecimal value.

    image

    Figure 3. Enter the hexadecimal value for your symbol into the Character code box.

    Now your text looks quite professional and complete (although a scientist would feel compelled to mention STP).

    water is H20 and it boils at 100° C

    To add subscripting, superscripting, and special characters in SSMS strings, string concatenation using the NCHAR function is necessary.

    image

    Figure 4. Building strings with the NCHAR function.

    SELECT N'H' + NCHAR(0x2082) + N'O';

    SELECT N'Ca' + NCHAR(0x207A) +  NCHAR(0x207A);

    SELECT N'E = mc' + NCHAR(0x00B2);

    SELECT N'98.6' + NCHAR(0x00B0) + N'F';

    SELECT NCHAR(0x03B2) + N'-blocker';

    SELECT N'X ' + NCHAR(0x2265) + N' 6.0221415 * 10' + NCHAR(0x00B2) + NCHAR(0x00B3);

    Try the preceding strings for yourself. The inverse of the NCHAR function is the UNICODE function, which returns a decimal value. You can use either decimal values or hexadecimal values with the NCHAR function. I showed mostly hexadecimal examples because I think you’ll most often find hex values when you are looking up the numeric value of a Unicode special character.

    image

    Figure 5. Working with decimal values.

     

    SELECT UNICODE(N'₂');

    SELECT N'H' + NCHAR(8322) + N'O';

    NOTE: Some of the code samples may not render correctly depending on the capabilities and settings of your browser. Thanks to my fellow SQL Server MVPs Greg Low and Rob Farley for technical assistance in writing this post.

    Using Unicode characters for superscripting and subscripting is particularly useful when markup languages can’t be used, such when posting in some social media platforms.

  • Speaking at Houston TechFest on October 15.

    I’m speaking at the free Houston TechFest on Saturday, October 15. If you haven’t registered yet, please do so ASAP. My topic is SQL Server Tips and Tricks. If you’re in Houston, check it out. There are many other topics and speakers so there should be something of interest to you. I hope to see you there!

  • Enabling custom spell checking in Word 2011 on a Mac

    I previously posted how to add a medical dictionary to Word 2010. It’s a simple matter of copying a file and adding it to Word. Although the concept is the same with Word 2011 on a Mac operating system, implementation on a Mac requires some additional effort. For those of you who aren’t Mac power users, I’ve provided screen captures detailing the tricks you must know to achieve success.

    The file you need is downloaded from here where where I posted how to add a custom dictionary to Word 2010 on Windows 7. Scroll almost to the bottom of the post and right-click the OpenMedSpel100.zip link to open the download menu. Select the Download Linked File As option.

    downloadFileAs

    Figure 1. Right-click the link and select Download Linked File As.

    Next, you must specify a file name and location for the dictionary file. You can use any file name and location. I chose en_US_OpenMedSpel100 for the file name and the Microsoft Office 2011 folder for the location.

    SaveAsFileName

    Figure 2. Under Favorites, select Applications, then select Microsoft Office 2011. Provide a meaningful name for the file (I used en_US_OpenMedSpell100) and click Save.

    You will need to navigate to your Microsoft Office 2011 folder and open the downloaded zip file to extract the dictionary file. You can do this by opening your Documents folder, then selecting Applications, and finally selecting Microsoft Office 2011. You can delete your zip file after extracting its contents if you want to keep your folders neat and clean.

    OpenZip

    Figure 3. Navigate to the Microsoft Office 2011 folder and open the zip file.

    Go to Word’s menu and select Preferences as shown.

    WordMenu

    Figure 4. Select and open Word’s Preferences menu.

    WordPreferences

    Figure 5. Select Spelling and Grammar on the Preferences dialog box.

    SpellingGrammar

    Figure 6. Click the Dictionaries button on the Spelling and Grammar dialog box.

    Custom Dictionaries

    Figure 7. Click the Add button to add the custom dictionary.

    NotSelectable

    Figure 8. The dictionary file appears but is not selectable. Select All Files to make it selectable.

    selectable

    Figure 9. Select your custom dictionary file and click the Open button.

    success

    Figure 10. Click OK to finish adding the custom dictionary file.

  • Spell checking in Excel

    Many people have added a custom medical spell checker to Word after reading my blog post found here, which was updated and simplified earlier today. Some people have mistakenly thought that spell checking in Office applications doesn’t work in Excel. It does, but you have to explicitly invoke it. When you invoke spell checking in Excel, it uses the standard default list of Words that come with Office as well as any custom dictionaries you may have added.

    Notice in the screen capture below that the words on lines 2 and 3 are misspelled but there isn’t any indication of the misspellings.

    image

    Figure 1. Excel with misspelled words. A custom medical dictionary file has been added.

    To invoke spell checking in Excel, either press the F7 key or go to the Review tab and then click Spelling.

    image

    Figure 2. Invoking spell checking in Excel.

    image

    Figure 3. Excel offering correction for misspelling.

  • Fixing PowerPoint 2010 on Windows 7 running on a MacBook

    If you try typing anything in PowerPoint 2010 running on Windows 7 installed in Boot Camp, PowerPoint may abort. The first time I installed Windows 7 on my MacBook Pro, PowerPoint 2010 worked just fine. But the second time was a disaster. PowerPoint aborted every time I tried to type anything. The fix is easy and is detailed in the screen captures shown below. You have to specify a keyboard layout to resolve this issue.

    I do not know why the first installation was fine and the second was not, but I am willing to speculate. The first time the Office 2010 suite was installed using defaults. The second time a custom installation was done and all features were installed. I do not know if that difference caused the problem, but in the interest of full disclosure, I thought you should know.

    pp1

    Figure 1. PowerPoint 2010 aborted on Windows 7 installed on a MacBook Pro.

    pp2

    Figure 2. Windows did not notify me of a solution.

    pp3

    Figure 3. Go to File and then select Options.

    pp4

    Figure 4. Select Language and then click the Not enabled hyperlink. The problem is caused by not having a keyboard layout specified.

    pp5

    Figure 5. Click the Add button.

    pp6

    Figure 6. Select an appropriate keyboard. Click OK.

    pp7

    Figure 7. Problem solved. Click OK.

  • Silently booting Windows 7 on a MacBook

    After using Boot Camp to install Windows 7 on a MacBook Pro, it is annoying to hear an Apple chime every time the machine is booted. It is easy to remedy. Although the noise is made before booting into an operating system (either Apple’s or Microsoft’s), suppressing it requires booting into Apple’s OS and changing a setting. Below you will see the screen captures showing you what to do.

    Pressing the mute button on the MacBook Pro keyboard when booting does not prevent the Apple chime when running Boot Camp. It was suggested that plugging in earphones will direct the bootup chime sound to the earphones instead of the speakers, but that doesn’t actually prevent the chime from the speakers to the earphones. Muting the sound as shown below is the only solution I found that works.

    Windows 7 works great on great hardware. My quad core 17” 1920x1200 matte screen MacBook Pro with 4 GB of ram and an SSD cost me $2,634.81, not counting the 2% cash back from my credit card. Although the cost is high, so is the value. The machine is light, has great battery life, is rugged, and has excellent performance. You can upgrade a MacBook Pro to 8 GB of ram by purchasing two 4 GB DIMMs from Crucial, which are $53.99 at today’s price. Other World Computing offers 12 GB and 16 GB upgrade kits, which are sizes not officially supported by Apple and cost hundreds of dollars.

    MacSystemPreferences

    Figure 1. Screen capture from Lion showing how to select the System Preferences.

    MacSystemPreferencesWindow

    Figure 2. System Preferences window. Click the Sound icon.

    MacSoundMute

    Figure 3. Sound Window. Select the Output tab. Check the Mute checkbox to stop the Apple chime on bootup.

  • Searching PowerPoint files

    PowerPoint’s find feature is limited because it works on only a single file at a time and I need to search groups of files. There is a simple, high value search capability available in Adobe Reader X that I’m using to search PowerPoint files. All I had to do was open the PowerPoint files with Office 2010/2011 and save them as pdf files. Using the advanced find feature in Adobe Reader X makes it easy to find a word in a group of files. I’m using this technique to prepare for final exams as I study the PowerPoint slides from nursing school lectures.

    I’ve also loaded my PowerPoint slides in SQL Server Denali with semantic search enabled and will investigate that after finals are over.

    Step 1

    Put all of the PowerPoint files you want to search in a separate folder. This isn’t technically required, but I did find it easier to have one folder per course.

    Step 2

    Open each PowerPoint file and save as pdf.

    Step 3

    Open any of the pdf files. Select Advanced Search or use Shift+Ctrl+F to go right to it.

    image

    Step 4

    Select All PDF Documents in and browse to the folder containing your pdf files. Click the Search button.

    image

    Step 5

    Find the item of interest in the search results. Notice that the results are hyperlinks. Click a hyperlink to be taken directly to the slide where the search term was found.

    image

  • Windows and Mac not playing nicely with zip files

    I’m having a terrible time with a new Cisco E4200 router and WMP600N dual band wireless network adapter. Cisco directed me to download a zip file of driver files, but they created it on a Mac. Zip files created on a Mac can sometimes unzip on Windows as NTFS encrypted files. Cisco doesn’t believe me, but it’s true nonetheless.

    Using the built-in Windows 7 unzip feature, Mac zip files will under still mysterious circumstances unzip on Windows as NTFS encrypted. In other words, they appear as green in Windows Explorer. This doesn’t happen if 7-Zip is used to extract the files. When the files were encrypted, I was not successful installing the driver. Since I have a portable version of 7-Zip on all of my machines, it’s more efficient to extract with 7-Zip than go to the trouble of unencrypting all of the files. It’s not just this particular Cisco zip file that has the problem as others have reported here.

    It would be nice if Cisco would not create zip files on a Mac if the files are really intended for Windows users. It creates an unnecessary problem that wastes the customer’s time and is difficult to troubleshoot. As a best practice, I’m not going to create any zip files on a Mac and distribute them to Windows users unless and until I can find a way to prevent this encryption problem.

    I’d like to see a few other people try to reproduce this problem. The zip file can be downloaded from here:

    http://homedownloads.cisco.com/downloads/driver/WMP600N_Win7_3_1_0_2_0.zip

    I’ve reproduced this problem on three different Windows 7 machines, both x32 and x64. The problem occurs with or without unblocking the downloaded file. If you can reproduce the problem, please report your results by adding a comment.

  • Adding custom medical spell checking to Word

    Adding custom spell checking to Word is easy. Office applications use lists of properly spelled words stored in simple Unicode text files will a file type of dic for dictionary. There is a legally free, GPL licensed medical list of words found at http://www.e-medtools.com/openmedspel.html. It isn’t in Unicode, so we’ve made a Unicode version of this custom dictionary file and packaged it in a zip file which you can download by scrolling to the bottom of this post. Under the terms of GPL licensing, you may download, modify, and redistribute this file only as a free product. GPL means once free, always free and this includes derivative works and any other kinds of enhancements to the original.

    This is a simple process of downloading a zip file, extracting it to a specific location, and adding to Word. If you understand the process, it will take about one or two minutes. It is like many other IT tasks where reading the instructions takes more time than actually doing the task.

    You can add custom dictionaries for engineering, foreign words, or whatever you need. Adding a custom dictionary affects all Microsoft Office applications, not just Word.

    Windows 7, Internet Explorer 9 and Microsoft Office 2010 were used for the screen captures shown below. Microsoft’s official reference for adding custom dictionaries is found here.

    Instructions for Word 2011 on a Mac operating system are found here.

    Step 0. Open Word and find the location of your custom dictionaries.

    Geek alert: If you are a geek, you can skip this step. The location you need is %appdata%\microsoft\uproof

    Since I’m using Office 2010, I select File and then Options. If you have a different version of Word, see the Microsoft KB article.

    image

    Figure 1. Word 2010 Options.

    Go to Proofing and click the Custom Dictionaries button.


    image

    Figure 2. Word 2010 Custom Dictionaries button.

    image

    Figure 3. Word 2010 Custom Dictionaries location shown to the right of File path.

    Copy the location of your custom dictionaries. On my computer, it is C:\Users\John\AppData\Roaming\Microsoft\UProof as you can see in Figure 3.

    Step 1. Download the zip file containing the custom dictionary.

    Scroll to the bottom of this post and click the OpenMedSpel100.zip link.

    Click Save as and save the zip file to your desktop.

    image 

    Figure 4. Save zip file dialog box.

    image

    Figure 5. Save zip file to desktop. 

    Step 2. Extract the zip file to the Uproof folder.

    Right-click the OpenMedSpel100 zip file and select Extract All.

    image

    Figure 6. Extract the zip file.

    Specify the location of the Uproof folder found in Step 0. On my machine, this is C:\Users\John\AppData\Roaming\Microsoft\UProof.

    image

    Figure 7. Specify the location of the Uproof folder found in step 0 and click the Extract button.

    Step 3. Open Word.

    Go back to Word’s Custom Dictionaries dialog box shown in Figure 3. Click the Add button on the Custom Dictionaries dialog box.

    image

    Figure 8. Select the en_US_OpenMedSpel100 file and click the Open button.

    image

    Figure 9. Click OK and you’re done!

    Step 4. Open Word or any other Office application to confirm your change.

    Enjoy working with your Office applications without the frustration caused by spell checking false positives.

    image

    Figure 10. Microsoft Word before (left) and after (right) adding the custom dictionary.

  • Matte vs. glossy

    Here's a great article explaining matte vs. glossy: http://www.robgalbraith.com/bins/multi_page.asp?cid=7-10041-10146&sr=hotnews. Scroll down toward the bottom of the page and look at the two photos. Do a mouseover to see what happens to a glossy display (top) and a matte display (bottom) when the blinds in the room are opened. The difference in the matte display is barely perceptible. Why people who actually do work on a computer would want a glossy display eludes me.

    Notice that the article is about Mac hardware with a WUXGA (1920x1200) display. Some of you may remember that I've been looking for a WUXGA laptop. For those readers thinking, no, he couldn't have, he didn't, did he? Yes, I did. I ordered a custom built Macbook Pro with an SSD and a 17" matte screen. I had to pay $50 extra for matte. Worry not, I will install Windows 7 on the machine and use a real external mouse.

    I could have purchased a 17" HP with an older, first generation i7 processor for a lot less. But it wouldn't have been truly portable. The HP is much heavier with terrible battery life and a power brick the size and mass of a real brick.

  • SQL Kinect Management Studio

    SKMS - yes, I made that up. But look here to see that Microsoft has released an SDK to connect Windows machines to Kinect. It's something I've been thinking about for months. I'd like to use Kinect to administer SQL Server. I understand that many people feel compelled to say that a Kinect interface for SQL Server is a complete waste of time and totally unnecessary. But wouldn't it be fun to try SQL Kinect Management Studio? I wonder if the Kinect SDK can make calls to PowerShell.

    UPDATE: As a reader commented below, SQL Kinect has already been done.

More Posts Next page »
Powered by Community Server (Commercial Edition), by Telligent Systems
  Privacy Statement