Tag: syndicated

  • Adding Objects to our SCA Project

    In my last post, I started out with a new SCA project, getting a connection to my database up and running. Now, let’s start the new project by adding some objects.

    Adding Objects

    I’m going to start with a couple objects to make this simple, but we’ll move on from there in other posts to describe the options and details.

    Our database is not terribly useful without tables, so let’s create a table. I’ll start by using a query window to build a table. Right click the database and choose New Query.

    2018-09-19-00_48_40-_thumb1

    Once this opens, let’s write a query. I’m comfortable building tables like this, so I’ll add the first table to hold my SQL Server builds.  I’ll write the code shown below and then execute this.

    2019-02-11 14_09_59-SQLBuilds - Microsoft Visual Studio

    At this point, the development database has a change, but it’s not in my project. I need to use the SCA pane to let VS know that I’m ready to import this change. Open the pane and click refresh. The following should appear when the process completes.

    2019-02-11 14_10_30-SQLBuilds - Microsoft Visual Studio

    In this dialog, we see a new table was found. The process compares the Shadow database, where no changes have occurred, with the development database, which has a new table. This gives me a “diff” in essence and I can add this to my project.

    The change is checked on the left, so I can click the Import and Generate Script button. I’ll do that and I see the image below. There’s a lot here, so let’s discuss this after the image.

    2019-02-11 14_20_43-SQLBuilds - Microsoft Visual Studio

    The first thing to look at is the script that’s active in the upper pane. If you notice, the tab name is on the right side of that upper left pane, highlighted in blue. This is my first migration script. You can see the migration ID at the top and then a PRINT statement, which is useful for logging during the build or deployment process, then the top of my code.

    On the right side, in the Solution Explorer, we see that my script has been added to the Migrations folder. The default name has been applied, but I can rename this if I want.

    In the SCA pane, we see a few things. First, the change is grayed out because the change was scripted.  Above that, we have a yellow bar that notes a migration was generated, and it gives us the path in the project. Finally, there is a “Refresh” button to verify the script. We want to click that. This will use our script with the Shadow database to verity the code is correct. Once I click that, I get a note that the project was verified.

    2019-02-11 14_21_52-SQLBuilds - Microsoft Visual Studio

    At this point, the Shadow and development databases are in sync.

    This tells me that my changes should work when I deploy them to another system. Hopefully that works, and we’ll tackle that next time.

  • What is my why?–T-SQL Tuesday #111

    tsqltuesdayThis is an interesting question from Andy Leonard for T-SQL Tuesday: What Is Your “Why”? He is this month’s host and asks us to talk about our motivation, our passion. The question is: Why do you do what you do?

    Why I Do What I Do?

    I have had a great career in technology. Moving from developer to system administrator to developer to manager, and back through various incarnations. I have had success in lots of positions and helped improve systems and code, teaching and mentoring others along the way.

    Almost twenty years ago, I participated in a user group and helped someone solve an issue. That inspired me to start writing articles that detailed how to build solutions that had helped me and my employer. Over time that led to SQLServerCentral and regular speaking and writing.

    My career in databases really started for the money. I worked with a DBA that was better paid than any sysadmin or developer, and began to study and work with SQL Server. As I earned more, I thought I’d made a good decision, but over time I realized that there was a point where money was less important to me.

    Time became the most important thing to me.

    There have been many times where I would have traded more time for less money, though that isn’t quite the case now as I have two children attending college next year. Still, in the middle of my career I wanted to, because of the value that I placed on time with family and friends and living my life.

    I started to give back with writing, speaking, teaching because I had people do that for me, and because I wished I’d had more. I wished that more people had shared solutions and ideas with me earlier in my career.

    I also believe that we fundamentally ought to help others in life when we’ve been helped or been successful. We ought to pay it forward where we can, but more so we need to pay it back. It’s a bit of a social contract with others, a bit of a desire to be the rising tide that lifts all boats, and a bit of a moral obligation I feel to help the world because I’ve been blessed with success.

    Everyone walks their own path, makes their own decisions, and follows their own moral code. I try to follow mine, and I hope to inspire others to help others where they can.

    It’s why I do what I do, and I’m lucky that I’m able to do so, both as my job, but also because I am able to help others.

  • Looking for More Storage

    I got a new cell phone. Not big news, but it’s primarily because I need want more storage. It’s a little indulgence, but it doesn’t change my budget much, so I decided to just upgrade.

    A couple years ago I moved to Google Fi. If you haven’t heard of it, Google decided to become a cell phone service provider. I think this was because of their Pixel devices, or maybe because Larry/Sergy just wanted to. Who knows.

    In any case, they offered a few phones with their service. The attractive thing for me was that they charged $10/GB of data, prorating usage and capping costs at $60. That’s a good move, especially as I sometimes go over 6GB in a month of heavy travel. At home, I rarely break 3GB, which means I may pay $30 or less for data. I think my lowest has been a $22.50 bill for 2.25GB.

    The other attractive thing was that they partnered with various providers to give no charge roaming around the world, using your existing plan. Not everywhere, but everywhere I go. This was a huge change from Verizon, which was a $10/day charge outside the US. That adds up quickly as I often have 5-10 day trips overseas. I’d gotten used to not using my phone, but that’s annoying, especially when trying to get directions.

    In any case, they offered only a few devices as their phones used a multiple carrier roaming tech to hop across multiple carries. They use Sprint and TMobile in the US, and fortunately, they cover the ranch. At the time, I wanted a headphone jack and the Pixel XL was the best choice. Unfortunately it only had 32GB models for sale.

    After a year and a half of that, I feel cramped. I’m constantly managing storage with all the pictures I take of family. Recently Google put the Pixel 3 and LG phones on sale, plus they offered a service credit. Since I still want to headphone jack, I settled on a 64GB LG G7, which will end up costing me about 5 months of extra charges for the device after credits and sale.

    Plus I can add a micro SD card to the device. Since I’m thinking to get a 128GB card, I guess that’s 6 more months of payments Winking smile

  • Pro SQL Server Linux–Moving to Linux

    As part of my learning goals for 2018, I wanted to work through various books. This is part of my series on Pro SQL Server on Linux from Bob Ward.

    It’s not until Chapter 10 that we get back to Linux specifics. Most of the chapters in the middle are general SQL Server items that are good to know, but not are useful for experienced SQL Serve professionals. They’re worth skimming as you might learn some things you didn’t about the features.

    In Chapter 10, the focus is migrating to Linux. Bob presents a number of options, including one I hadn’t heard of: the DEA. This is the Database Experimentation Assistant, and I hadn’t heard of it. I don’t do a lot of migrations as I start and stop on SQL Server, but this allows you to do some A/B testing of upgrades. I’m sure it’s not perfect, but that’s something that is definitely needed.

    Most of the chapter is about versions, from Oracle, or from PostgreSQL. The Oracle parts walks through the migration, while the PostgreSQL part tries to show where features in SQL Server exist or don’t in PostgreSQL. In a number of places, Bob found projects that provide some functionality in PostgreSQL that is in SQL Server, but didn’t test things.

    The last chapter of the book deals with containers, and that was one of the more interesting things for me to read. I’ve been on a bit of a container kick, digging in more and more, so I was curious to see how Bob described and talked about the technology. I think he did a good job, but I still think a couple courses I’ve watched on Pluralsight from Nigel Poulton really covered this well, so perhaps I glossed over this a bit.

    I liked that Bob includes lots of code and links to help you get started, so if you read this book, spend time on containers. They’re the future, and for now, Linux containers rule.

    Overall Review

    I learned a few things about SQL Server from the book, but far too much of it was basics and beginning SQL Server stuff, not Linux stuff. It was a good refresher, and I’m not disappointed in the time I spent, but I was hoping for more stories and more Linux.

    The lesson really is that SQL Server is SQL Server, with few differences on the platform. As Bob mentions, you shouldn’t care about the platform and just pick what works.

    The basics of SQL Server did make this hard to read, and as a result, I started strong at the end of December and hit a lull for almost two weeks where I wasn’t motivated to skim through basic T-SQL, security, etc. I realized around the 20th that I was running out of time and crammed a bit in.

    If you don’t have a lot of experience with SQL Server, this is good. If you know SQL Server, but want to know Linux differences, I might recommend digging into some of the more specific Linux blogs, or the SQLServerCentral Stairway series.