Category: Blog

  • Why Learn PostgreSQL?

    At Redgate, we’ve spent a lot of time adding PostgreSQL functionality to our DevOps tools. We’ve also hired an advocate, Ryan Booz, to help us spread the word and educate everyone about the platform.

    How important is this? It’s hard to know. I know all the major vendors offer flavors of PostgreSQL. Azure has Azure Database for PostgreSQL, AWS has Aurora and RDS, and Google has AlloyDB. I also see plenty of customers using PostgreSQL in some way.

    On Redgate.com, there is an article on What is PostgreSQL, and why do businesses need to know more about it? This is a general, high level article that highlights a few things from perspective of business usage. While there aren’t a lot of details, I do find more companies embracing PostgreSQL and other platforms outside of Oracle/SQL Server.

    I also noticed a webinar coming tomorrow, PostgreSQL 101: Why PostgreSQL in 2023?, that I am going to try and watch.

    I’ve been working with PostgreSQL lightly, and it’s in my Flyway PoC series. I find it both interesting, and in many ways, the same as working with SQL Server. Much of my knowledge transfers, so I’m not worried about learning to use it more in depth if needed.

    If you’re worried about your company leaving SQL Server, maybe you want to spend time working with another platform, if for no other reason that you can build some familiarity with tools. However, I don’t know I’d recommend many SQL Server spend time here without a pressing need, and I don’t know that I would advocate for my company to switch. There is a lot to learn, and I think the time spent converting knowledge could outweigh licensing costs.

  • Exporting SQL Data Compare Results to Excel

    I had someone ask recently about getting SQL Data Compare results in Excel. It’s easy to do and this post looks at the process.

    Exporting a Comparison

    I won’t go into the details of making a comparison. I have another post that looks at this with joins, but the tool is fairly intuitive (ingeniously simple) to use.

    Once you have a comparison, you should see something like this image. Here I have two tables that are different (I selected all tables). The first, dbo.CountryCodes, has a difference in a row, different values in the name.

    2023-04-14 13_47_56-SQL Data Compare - E__Documents_SQL Data Compare_SharedProjects_(local)_SQL2017.

    The second, dbo.Status, has some rows in the source (left) that are not in the target.

    2023-04-14 13_48_02-SQL Data Compare - E__Documents_SQL Data Compare_SharedProjects_(local)_SQL2017.

    To export these results, I use the Tools menu. There is an option you can see below:

    2023-04-14 13_48_08-

    Once I pick this, I get a dialog with options. I can pick certain tables, or all. The defaults are all tables, and only show differences. Note the identical button is not selected.

    2023-04-14 13_48_17-Export CSV files

    If I open the folder in the dialog above (after clicking Generate), I see my files. There are separate files for each table and one with a summary.

    2023-04-14 13_48_24-Reports

    If I double click the dbo.CountryCodes.csv file, Excel opens, but not the way I like it. I see this:

    2023-04-14 13_58_46-dbo.CountryCodes.csv - Excel

    However, if I File | Open the file, I get the wizard for delimited files.

    2023-04-14 13_59_00-Expenses 2023.xlsx - Excel

    When I go to the second page and click “comma” as the delimiter, I see a better preview.

    2023-04-14 13_59_05-Text Import Wizard - Step 2 of 3

    I can finish this and I see my data. In this case, the first column lets me know this is changed data that has the same row with the same PK in both databases.

    2023-04-14 13_59_22-dbo.CountryCodes.csv - Excel

    Similarly, I get open the Status table file and see this. Here the first column lets me know this data is only in the first database, the source or left database, that I set in my SQL Data Compare project.

    2023-04-14 13_59_50-dbo.Status.csv - Excel

    The summary also needs the same open process and this shows me all tables, with lots of zeros. However, for my two tables, you can see there is 1 row noted in the Different column for CountryCodes and 3 rows only in the source (SimpleTalk_1_Dev) database.

    2023-04-14 14_00_35-Results Summary.csv - Excel

    I can then save these in Excel format if I like and send them around to colleagues.

    Summary

    You’ve seen how you can review SQL Data Compare results in Excel. I don’t know if your Excel will open the CSV with values in separate columns, or if you need to perform a File | Open as I did.

    This is useful for sending to a business user that might need to make decisions about what data needs to be synched where. The hardest part here is explaining the _s and _t names for source and target.

    SQL Data Compare is very handy for single GB data sets to compare. I wouldn’t recommend this for > 10GB, but under that, with good hardware, you should have success comparing tables or views.

    If you’ve never tried it, download an evaluation today.

  • A Tale of Two Drives

    One of the things I haven’t thought about much with my Tesla is range anxiety, even in winter. However, I recently had two almost identical trips with vastly different temperatures. This post looks at what I learned.

    This is part of a series that covers my experience with a Tesla Model Y.

    The First Drive

    In early April I took a day off to go skiing. I used to do this often based on weather, picking sunny and cool days. However, in 2023 I’m more schedule driven. I had to do this particular day because I had the free time.

    I woke up and it was about 12F outside. The forecast for Keystone for the day was a low of 1F and a high of 41F. A wild day, so I set out from home. I’d charged the car to 90% the night before, which was a failure on my part. The car had been set to 90, and I had meant to change this to 98, but forgot.

    I drove up, stopping a few times for coffee, food, and the restroom. I arrived at the resort parking lot with 35% charge left. It was 7F, and I was a little worried about skiing, but I assumed it would warm up. This also meant I’d used 55% of my charge getting up to the mountain.

    It was a nice day, and I enjoyed skiing, leaving around noon. At this point it had warmed up to 34F. I actually showed 36% on the battery driving home. When I mapped going home, the car recommended a charging stop in Idaho Springs for about 5 minutes. Since I planned on lunch from Beau Jos, that was fine.

    I parked, walked to the gas station to get a soda and then picked up my pizza. I charged for about 12 minutes, getting 27kW added. More than I needed. I arrived home with 37% left. With all the stops, I ended up going 221.4 miles on 91% charge.

    Possibly I could have made it on a single charge.

    A Spring Ski Day

    A few weeks later, I went again. This time it was around 50F when I left home. I arrived at the resort, where it was about 25F, but warming quickly.

    This time I’d charged to 96% the night before. I got to the parking lot with 49% left. Around 47% used. When I left for home, same lunch stop but not charging, I felt comfortable. I pulled into the garage with 22% left on an 80F day near my house. This trip was 217.7 miles.

    Summary

    There is a huge difference between a 30-40F day skiing and a 10-20F one. The car definitely loses some range in the cold. It’s worth paying a little attention here, but I probably could have avoided Super Charging, or at least done less, if I had charged more at home before the first trip.

    In terms of comparison, the drives up were roughly the same, same stops. I used 55% in extreme cold and 47% in cool weather. 8% difference here.

    The drives back had a few different stops as I ran different errands, but 36% returning from the mountains in the cold. In warmer temps, it was 38%. One thing to note is that the return trip in the cooler weather was more like the going up in warmer weather. Coming home the second time the AC ran a bit.

    I got this car because it had the range that I thought would let me day ski without an inconvenient charging time on the way home. I don’t know other EVs would do that, but with the Tesla Superchargers in Idaho Springs, Silverthorne, and Park Meadows on my journey, I had some leeway to stop quickly. Even in cold weather, and skiing in 15F weather is rare for me, I likely could have made this without stopping.

    However, life is life. Sometimes things don’t go your way. The charging stop wasn’t inconvenient at all since I needed a restroom and lunch. I actually got the notification from the car it was charged enough while walking to get my lunch.

    EVs are interesting, and they have a different paradigm. I have ceased thinking about range almost all the time, but I do plan differently than I do with ICE cars.

  • Off to the 2023 Microsoft MVP Summit

    I’m off today to Seattle, Redmond actually, and the Microsoft MVP Summit. This is an annual conference Microsoft has run for their MVPs, allowing them to interact and learn from the developers for various products.

    I am a Microsoft Data Platform MVP, which means that I’ll mostly be seeing sessions and talking with the developers for SQL Server, Azure SQL, Synapse, etc. All the Data Platform stuff.

    The entire event is under NDA, so I can’t discuss anything that happens or what I will learn. At least not this week. A lot of this will come out from under NDA in the next few months, and this event gets me the chance to work with some things before they become public.

    It’s also the chance to get to know the developers and product managers better. I’ve become good friends with some over the years, and I look forward to the chance to not only learn from them, but share a meal or drink at some point this week.

    A quick trip, out today, back Thursday. Just in time to meet the tractor guy Friday.