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

  • Smartphones and data plans

    Smartphones can do a lot of useful things, but what do you really need to do when you don't have access to a wireless network? Would voice and text be enough when you're not at home, the office, Starbuck's, or a convention? I'd like to have a smartphone without a data plan. I'm willing to pay the full price of the phone and own it outright. I'd like to have the legal right with my smartphone to purchase as few or as many services as I want from any carrier. But this isn't possible today. If you want to use a smartphone, all of the major carriers require you to have a data plan. I don't need a data plan. If I really need to do something at home, at the office, or at school, I can use a secure wireless connection and do whatever I need.

    Yes, a data plan can do more for me than wireless connections can. But I don't find the added convenience of a data plan worth the cost. The marginal utility just isn't enough. I contacted my U.S. senators and representative asking for consumer friendly legislation allowing smartphone owner (i.e., people who pay full price for a smartphone unsubsidized by the carrier) to purchase service without a data plan. Obviously, with one of the largest carriers headquartered in my state, that request for legislation is not going to go anywhere.

    One of my young classmates in nursing school was baffled when I said cellphones hadn't been invented when I was dating. She asked how people could date without a cellphone. We did it without a data plan monthly expense.

    How about you? Would you like a smartphone without a data plan, just text and voice? And while I'm asking questions, have you ever done any SQL Server administration from a smartphone?

  • Windows 8 Consumer Preview and SkyDrive

    SkyDrive integrates very nicely with Windows 8. More on that later. First, let’s discuss using Windows 8 x64 on VirtualBox. Since I wanted to test with x64 and didn’t have a Hyper-V server available, I used VirtualBox. The latest version of VirtualBox does list Windows 8 as a guest operating system choice. The first time I attempted the installation, I chose the experimental Direct3D graphics support. That didn’t work well. After what seemed like FOREVER looking at a completely black screen, I decided the experimental Direct3D graphics and Windows 8 Consumer Preview were not a good combination, so I reinstalled Windows 8 from scratch leaving that option uninstalled. Depending on when you actually read this post, it might work just fine. Eventually both Windows 8 and VirtualBox Direct3D will probably be compatible.

    image

    Figure 1. Leave the Direct3D Support (Experimental) unchecked.

    I keep all of my SQL Saturday presentations and MVP Deep Dives files on SkyDrive. Windows 8 integrates with SkyDrive seamlessly. As a full-time nursing student, I also keep all of my school files on SkyDrive. I think both working professionals and students will like the seamless integration of cloud storage with Windows 8. Here’s what it looks like:

    image

    Figure 2. SkyDrive application in Windows 8 CTP.

    Notice that it says John’s SkyDrive. During the installation process, I was prompted for my Windows Live ID, which is my Hotmail address. That is my login to the Windows 8 machine. Windows 8 clearly has the cloud baked in.

    One thing that immediately caught my attention was that even though I hadn’t installed any applications, my pdf files were viewable. The Microsoft Reader is preinstalled and reads pdf files. That’s quite convenient. Office documents were of course readable with the Office Web Apps. Next, Office 2010 was installed to view the SkyDrive documents in local Office programs. Although Office 2010 with all programs and features was installed, the Office Web Apps couldn’t detect that Office 2010 was actually installed. I filed this bug report: http://answers.microsoft.com/en-us/windows/forum/windows_8-winapps/skydrive-not-detecting-powerpoint/dcabc763-5b5a-424a-a050-461a80b3899f

    Also, I didn’t like the usability of closing a SkyDrive document and not returning back to the SkyDrive application. Instead, I returned to a SkyDrive web page in IE. I filed this item: http://answers.microsoft.com/en-us/windows/forum/windows_8-winapps/skydrive-and-closing-office-web-apps/7832f1c5-5599-4a46-b428-49d98165d0c5

    Unrelated to SkyDrive, I found that a rare and obscure bug in Windows 7 is still a bug in Windows 8. This bug report was filed: http://answers.microsoft.com/en-us/windows/forum/windows_8-files/windows-7-unzip-bug-still-in-windows-8/eee093ff-1dd1-4e50-ae99-a084172326fe

    I didn’t find any major problems and definitely liked what I saw. SkyDrive will be much more useful to more people when Windows 8 is used.

    Finally, the Betta splendens fish from the Windows 7 beta is back. I was expecting 8 bubbles to the 7 bubbles in the Windows 7 beta, but didn’t see what I was expecting. I looked a second time. Two of the bubbles are joined to form an 8.

    BettaSplendens

    Figure 3. Windows 8 Consumer Preview default desktop.

  • [OT] Going the distance on Valentine’s Day

    This story didn’t actually take place on Valentine’s Day but it is appropriate to tell on Valentine’s Day.

    How far would you go for someone you love? When our first born child was a toddler, something made of glass fell to the floor. One of us quickly picked the barefoot boy up off of the floor before he could step on the broken glass. Then the work began. After much sweeping and vacuuming, my wife and I had an uneasy feeling. I opted for a technical solution. I got a flashlight, turned off the lights, and used the flashlight to find more glass.

    But was it enough? I wasn’t satisfied. I took one look at those cute little bare feet of his and I immediately knew what I had to do. I took off my socks and shoes and walked around with my bare feet until I found all of the remaining tiny glass fragments. After I removed the glass from my feet (the red dots made the fragments easy to locate), my son was set free to safely run around until bedtime. Happy Valentine’s Day, son!

  • 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.

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