THE SQL Server Blog Spot on the Web

Welcome to - The SQL Server blog spot on the web Sign in | |
in Search

Roman Rehak

  • Presenting at Montreal SQL Server User Group

    Tomorrow (5/24) I will be presenting at the Montreal SQL Server User Group meeting. It's a double topic presentation - Introduction to SQL Azure, and SQL Server Reporting Services Programming. It's the usual meeting place, the Microsoft building at 6:30.

     Hope to see you there.

    Attention - la présentation sera en anglais

  • SQL Saturday #59 followup

    My session at SQL Saturday #59 went great, the room was packed with people sitting on the floor. The only thing I didn't like was that I had to compress 75 minutes to 50. My apologies to Allan Hirt for not getting out quickly, I got a little carried away when I was approached by people asking questions, including a guy from my native Slovakia. My session materials can be downloaded from the SQL Saturday schedule website. It is not exactly intuitive, but available session downloads can be identified by an asterisk after the title.

    Overall, great event again and nicely executed logistics. I almost didn't make it on time, I got stuck in slow traffic on I-87 South. I got off in a scary looking area in Bronx, got stuck in traffic again on Upper Broadway and then my bike died because the electrical system was overloaded by my heated jacket and heated grips. Luckily, the bike started 15 minutes later so I made it to the parking lot I had prebooked, only to find out they do not allow motorcycle parking. So I quickly parked elsewhere but had to pay $50 for 3 hours. The ride home went well but once I hit Vermont, the temperature dropped below 30 and my feet started hurting pretty bad. A gas station attendant suggested using hand warmers he was selling, I dropped them in my boots and couldn't believe how well they worked. My 2010 good luck with law enforcement continued, I got passed by a VT state trooper while I was doing about 78 in a 65 zone. He looked at me, nodded his head, and continued speeding himself at around 80.

  • Speaking at SQL Saturday #59 in New York City

    I will be presenting this weekend at SQL Saturday #59 in NYC, doing my favorite session SQL Server Development Tips and Tricks. The schedule for this event looks very good. Looks like the event is "sold out" so I expect pretty good attendance, especially since I am doing the only developer oriented session in my time slot.

    The forecast is as good as I can expect this time of year (no snow, mid 30s temperatures) so I will be going on the bike, newly equipped with a larger windscreen to shield me from the cold.

  • PASS 2010 afterthoughts

    Last week I was in Seattle at PASS, just like everyone else that's at least remotely interested in SQL Server. Here is a collection of miscellanous thoughts and observations:

    - This was my summit #10. I still recall my first PASS ten years ago in San Francisco. It was very small compared to this one and SQL Server was still not taken seriously in the enterprise world. How much has changed in 10 years...
    - Speaking of changes, Kevin Kline hasn't changed a bit in 10 years. That's one advantage of your hairline settling early on in life.
    - The new management company behind PASS is doing better job running PASS, but I still miss the SmithBucklin crew at the parties. They sure knew how to have a good time
    - The Tina Turner impersonator was great, but I would've preferred Rushabh lip syncing in that shiny dress and big wig
    - I still don't get that whole Twitter thing
    - I decided to count all the friends and acquintances that I ended up chatting with, the number was somewhere around 70. Made a few new friends and reconnected with others
    - I am glad I got to see Buck Woody doing a talk before the Microsoft HR bans him from public speaking. But then again, Charlie Sheen is still on TV and remains the highest paid actor, so you never know
    - A few more MVPs joined the mothership and work on the SQL Server team now. Does it have anything to do with the recession?
    - Booth babes were used heavily in the expo hall to get you in, then quickly get you redirected to the technical people. How outrageous!!!
    - From what I saw, the AlwaysOn technology will be huge for people like me running a bunch of 24/7 data centers, if they get it right. Sadly, have to wait for CTP2
    - Similarly, the columnar index will be huge for DW tables, if it really runs 100x faster as they claim it might
    - One slide about AlwaysOn was funny, promising that it will protect us from unplanned hardware failures. Can somebody explain to me what a planned hardware failure is?
    - We may be geeks, but we know how to party

    And finally, here is a tip for the next PASS - wear cargo pants to the Welcome Reception and BYOB. I am not cheap by any means but $8 per beer, common...


  • Moving SQL Server aliases to another computer

    I utilize SQL Server aliases a lot, especially since for some reason I don't get name resolution on our network over VPN. So I typicaly create an alias and map the name to the IP address of each SQL Server I use a lot on the network. I am in the process of setting up a new laptop and I was going to start recreating them. Then I remembered that since aliases are stored as registry values, I could use the registry import/export feature. I wasn't sure if it would work between Windows Server 2003 and Windows 7 but luckily, it did.

     If you want to do this, go to the "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\Client\ConnectTo" node, you should see all your aliases there. Then, export the whole node to an REG file, transfer the file to the other computer, and import it through the menu or by running the REG file.



  • SQL Azure free trial extended till March 31st 2011

    If you are interested in checking out SQL Azure for free, they just extended the trial period till 3/31/2011. What it boils down to is that you get to have a 1GB web database free of charge for 3 months, Good deal if you want to evaluate what this Azure fuss is all about. If you exceed your allowance, you will get charged, but they do it in daily increments. I created a second database and kept it around for a day, I received a hefty bill of $0.10. Considering it ran as a credit card transaction, Microsoft probably lost money on that.

    Also, keep in mind that you do not get charged for the master database. It shows there, you can look at it, but you can't even create tables in it.

  • Issues with 2008 to R2 upgrade

    I was recently upgrading a production server to R2 and it turned out to be a fairly frustrating, and in the end unsuccessful experience. This was the Standard Edition. The installer popped a message and said that the system needed to be rebooted due to some leftover files from the previous install. After I clicked OK, the install continued. Not what I would've expected. At the end I got a warning that the upgrade failed. I rebooted and examined the server, all the shared components and Management Studio were upgraded to R2, the engine and everything else remained 2008. When I ran the install after that, the rule check failed and the install wouldn't continue. This was the detailed message:

    Rule "Previous Upgrade" failed. A previous upgrade that failed was detected. To retry the upgrade, remove the upgraded feature that failed, and then run the upgrade again.

     It is not exactly clear what they mean by that. Browsing back in the installer, all the features that needed to be upgraded were selected and grayed out, you couldn't uncheck any of them. If they mean that you should uninstall all the features that now cannot upgrade, it is no longer upgrade, at that point you are reinstalling. And if I uninstall a 2008 feature and then reinstall it, in my opinion that would be risky because God knows how the 2008 installer will do since an R2 install was already run on the machine. So in the end, I detached the databases, scripted out the logins, uninstalled the entire SQL Server and started from scratch.

    This BTW is the third time a 2008 to R2 upgrade failed at my company. I didn't do the other upgrades so I don't have the details. But as a precaution, I would highly recommend that you treat the upgrade as a potential failure, and be prepared to reinstall your SQL Server and recreate all the databases and settings.

  • SQL Saturday #39 in NYC

    This weekend I will be speaking at the NYC SQL Saturday. The whole event was supposed to be BI focused but now the schedule shows a lot of non BI stuff as well. I will be presenting SQL Server 2008 Reporting Services Programming, one of my favorite topics to present on. It seems that the event is fully booked. I'll be coming down on my bike taking scenic roads through MA and CT so I will not make it to the speaker dinner. But the forecast looks good so I am pretty psyched to finally venture out of Vermont.


  • SQL Saturday Boston 2010

    Yesterday I presented my "SQL Server Development Tips and Tricks" session at SQL Saturday #34 in Boston. Here are some of my thoughts and observations:

    • I've been crazy busy the last two weeks and only got some time to work on my session Friday evening. I've done this presentation many times so I wasn't worried but it still pays to make sure all the demos are working and re-learn what all the starting points for the demos need to be, things like "delete these objects" or "create a blank database first". The drive to Boston is 3.5 hours from my house so that gave me a chance to rehearse my slides. When I first got into speaking I felt weird about rehearsing but all the public speaking books I got really encourage that and as it turns out, many big shot CEOs and other people who are naturally gifted speakers still do it. I usually end up going over each slide at least twice, I find that it really helps me with the flow. The demos are a little easier but I still do those at least once.
    • This was my first SQL Saturday and I found the overall atmosphere really relaxed and much more friendly than a conference setting. I had at least 15 people stopping me after the session to either say they liked the session, or to thank me for speaking. I had many discussions in the lunch room and discovered that despite of what their driving habits might imply, people from Boston can be very friendly. Overall, there was a great community feel. I also noticed a higher percentage of women than ever before so all those "Women in Technology" initiatives must be paying off.
    • Just like Aaron mentioned, I also need to train mylelf better to repeat all the audience questions. Before each presentation I have every intention of doing that but somehow I keep forgetting to do that.
    • Part of my session materials is my own utility for executing SQL scripts. I will be releasing it soon for public use, I just need to write basic documentation and capture some snapshots.

    Adam and Grant did a great job pulling this together. I am looking forward to speaking at the next SQL Saturday in Boston. I am also planning to submit proposals for some other ones as long as they are within one day drive (or hopefullly ride when the weather gets warmer).


  • Your work may not be lost

    One of the things that I found dissapointing in Management Studio 2008 is that in the event of a crash (and in addition to crashing in the first place), is that on a restart it doesn't show me a dialog with a list of auto-saved files, like my SSMS 2005 did. Yesterday as I was doing some houskeeping on my disk, I noticed a Backup folder under My Documents\SQL Server Managamnet Studio. I looked to see what's there and I saw a bunch of ~AutoRecover.~vs*.sql files, one for each query window in SSMS I was working with. This morning my SSMS crashed and when I reopened, there was no dialog for potential recovery. So I went to that folder and luckily, all the files were still there. I haven't searched Connect yet but I will, and report this as a bug. If there are any files in that folder, the user should be prompted with the option to recover.
  • OT: Corrupted Outlook file

    This is not a SQL Server post but it might be beneficial to some of you. 

    Over the last few months I've been having huge issues with Outlook 2007. Aside from running like molasses on a cold day, it consistently crashes a few times a week. Instaling the hotfix fixed things for a while, then the bad behavior came back.

    Last week it would just hang and never open, totally using up all the resources to the point where it took me 4 minutes to kill the process. I ran the SCANPST.EXE utility to fix it but it exited telling me that the PST file failed a redundancy check. I get the same error when I try to copy the file to my external drive. I was ready to give up and recover my waaay old backup of the PST file, when I decided to do more searches on the topic. Eventually I discovered this recovery program called Stellar Phoenix Outlook PST Repair. This product was amazing, it was able to recover thounds of emails from the file so corrupted that even a Microsoft utility gave up on it. If you run into a similar issue, give it a try. For me it was worth the price I paid for it.

  • Backup compression no longer Enterprise edition only

    Last week at PASS I had a discussion with a program manager on the SQL Server team and he told me that in SQL Server 2008 R2, backup compression will be available in the Standard edition. I suspect this announcement will leave many of you very happy. It is certainly good news for my company since we have quite a few auncilary servers with large databases, but not critical enough to justify enterprise licenses.

    For more details about feature breakdawn in R2, look here -

    Just as a side note, I am a little surprised to see the processor licenses going up by so much compared to SQL Server 2008. These days as more and more companies are seriously considering MySQL, I would expect to see the pricing going the other way. But then again, SQL Server is selling really well so maybe MS is not worried too much about this just yet.

  • PASS 2009 recap

    This week I was at PASS just like many other folks from here. Good times as always, although less partying than in the past. Since I am still in recovery and relying on Percoset to get me through the day, I was wiped every evening. Here are a few thoughts and observations:

    - I salute PASS marketing for being able to keep the number of registrations as high as they did in this economy. On the other hand - if you are not going to give attendees a free drink or two during the Welcome Reception, then at least the price of the drinks in the cash bar should not compete with the high end bars in Seattle. I know times are tough but from what I heard around me, quite a few people were not happy about this. Enough said...

    - Based on all the sessions, previews and announcements, SQL Server 2008 R2 doesn't have that much new stuff to get excited about by developers or even DBAs, compared to the long list of new features in 2005 and 2008 (the story is totally different for BI). And that's OK, I'll settle for a stabilized 2008. In the last few months I've seen enough strange issues in our 2008 deployments that I am seriously considering using 2005 until at least one more 2008 service pack.

    - I really like PowerPivot and I think it has a lot of potential, but I really think this tool should be integrated with Reporting Services and not with SharePoint. Otherwise, a lot of folks will still use it but for delivery they will just go back to what Microsoft is trying to avoid here - distributing reports via network share or email.

    - I really enjoyed finally meeting Buck Woody in person. Buck, aside from being a fellow motorcyclist and the most entertaining geek speaker I know (politically correct or not), always packs tons of good content into his sessions. I will definitelly be checking out the Management Data Warehouse feature. 

    - I am really glad I was able to tell the tools team that Activity Monitor needs to work ESPECIALLY when my server is pegged and otherwise not very responsive. GUI troubleshooting tools sometimes remind me of that saying about insurance - it's good until you need it.

    - A lot of people waited 10 or more minutes to get Kevin Kline to sign a copy of his book. I don't think they would do the same if the other Kevin Kline was signing autographs there.

    - After talking to a few people about virtualization, I am planning to try it again with Hyper-V. We've had not so good results with VMWare and SQL Server at my company, but it seems that since there is a lot of collaboration between SQL Server, Windows and Hyper-V teams, the penalty for disk I/O may not be so high as we have seen in VMWare.

    - I still don't know why everyone was wearing kilts on Wednesday. Buck is still having nightmares from what he saw under one of them...


  • Issue with restoring 2000 backups on 2008

    Recently we've been experiencing a lot of headaches with SQL Server 2008 crashing while restoring a backup taken on a SQL Server 2000 production server. The crash resulted in a stack dump but SQL Server would continue running, although less stable, and sooner or later needed a reboot.

    The error was saw was this:

    Error: 3414, Severity: 21, State: 1.

    An error occurred during recovery, preventing the database 'XYZ' (database ID 10) from restarting. Diagnose the recovery errors and fix them, or restore from a known good backup. If errors are not corrected or expected, contact Technical Support.

    In addition, the event log in SQL Server has many info messages about the stack dump. I've been working with SQL Server support on this and as it turns out, there is an issue in the code that reads a 2000 backup and restores it on 2008. It works OK going from 2000 to 2005. The issue has been fixed in the Cummulative update 3 for SQL Server 2008 -

    If you run into this issue, you can request the hot fix from the above URL.

  • SSRS report rendering from command prompt

    A while ago I posted on what now seems to be a defunct blog site, SQL Junkies, a blog about how you can use the RS scripting utility to generate SQL Server Reporting Services reports from command line prompt. In preparation for the DevTeach conference I decided to resurrect it for a demo and since a few things changed between SSRS 2000 and SSRS 2008, it required some work and digging through books online. One of the changes was that starting with SQL Server 2005, Reporting Services provides two separate web service endpoints. The ReportService2005 service is used for management and administrative functions, and the ReportExecution2005 service contains functions related to report rendering. By default, RSS script connects to the management endpoint but in this case since I wanted to use the render function, I needed to connect to the other endpoint. So, the trick here is to use the new endpoint (–e) switch parameter and specify RsExec2005 to use the execution endpoint instead.


    Here is a code sample showing rendering from the command prompt, the following DOS command runs the utility against specified report server (-s parameter) and instructs it to execute a file that follows the –I parameter. The third parameter specifies the execution endpoint:


    rs -i "c:\temp\reports\Render Report.rss" -s http://rrehak/ReportServer_Katmai -e Exec2005


    The RSS utility will render a report (I am using one of the sample Adventure Works reports) and save the rendered file in MS Excel format. The contents of the Render Report.rss file look like this, you may need to modify to match your path to the report:


    Public Sub Main()

      Dim format as string = "EXCEL"

      Dim fileName as String = "C:\temp\reports\Product Line Sales.xls"

      Dim reportPath as String = "/AdventureWorks 2008 Sample Reports/Product Line Sales 2008"


      ' Prepare Render arguments

      Dim historyID as string = Nothing

      Dim deviceInfo as string = Nothing

      Dim extension as string = Nothing

      Dim encoding as string

      Dim mimeType as string

      Dim warnings() AS Warning = Nothing

      Dim streamIDs() as string = Nothing

      Dim results() as Byte


      rs.LoadReport(reportPath, historyID)


      results = rs.Render(format,  deviceInfo, extension, _

       mimeType, encoding,  warnings, streamIDs)


      ' Open a file stream and write out the report

      Dim stream  As FileStream = File.OpenWrite(fileName)

      stream.Write(results, 0, results.Length)


    End Sub


More Posts Next page »
Privacy Statement