Category: Blog

  • Daily Coping 30 Jul 2020

    I’ve started to add a daily coping tip to the SQLServerCentral newsletter and to the Community Circle, which is helping me deal with the issues in the world. I’m adding my responses for each day here.

    Today’s tip is to catch yourself overreacting and take a breath.

    I didn’t remember to breathe recently, but fortunately my wife helped me.

    Our sink got clogged up recently. I cooked some breakfast, and afterwards, I threw out a few pieces of old chicken that were in the fridge as I started me cleanup. The sink clogged, and I couldn’t get it to work. I took a break, then ran to the store for a snake, which I tried to use. I ended up taking apart the lower U joint and getting all 20ft down into the pipe, but I still looking at this:

    20200715_173004_HDR (1)

    I worked on this for a few hours, doing a little work when I needed a break, but at 5pm, I couldn’t figure anything out. I was frustrated, upset, stressed as I had some deadlines at work, I didn’t get to exercise, and I still didn’t have a working sink for dinner.

    My wife reminded me to breathe, to relax, and forget about it. She called a plumber for the next day, told the kids to find leftovers, and took me out for dinner and a drink to relax. It was good to just stop worrying about a minor thing and just move on with life.

  • Adding a FK to a Table–#SQLNewblogger

    Another post for me that is simple and hopefully serves as an example for people trying to get blogging as #SQLNewBloggers.

    One thing that helps ensure your data is intact and doesn’t get out of synch in a relational database is a foreign key. You ought to have these as a part of your design, ensuring that a linkage between a parent and child cannot be broken.

    This post looks at adding a FK to an existing table. I’ve written about how to do this in the CREATE TABLE statement in another post.

    I have two tables set up: Contacts and Status. Both of these have a StatusID column in them. The Status table contains the lookup values, and these are stored in the child table, Contacts.

    To add the foreign key, I add a constraint with the ALTER TABLE ADD CONSTRAINT syntax. After this, I use FOREIGN KEY to list the column(s) and then the REFERENCES phrase to point out the parent table and column.

    The example is shown here:

    ALTER TABLE dbo.Contacts
       ADD CONSTRAINT FK_Contacts_Status_StatusID FOREIGN KEY (StatusID)
          REFERENCES dbo.Status (Statusid)
    ;

    This will give me  a FK that enforces the values in Contacts as existing in Status.

    SQLNewBlogger

    I had to do this recently and decided to quickly write this up as I had to look up the syntax to be sure I remembered it correctly. Then it took me about 5 minutes to produce this.

    It took me almost as long to see if I’d already written about altering a table with a FK.

    Do this for your career, and to show interviewers that you know how to handle common data referential integrity tasks.

  • Daily Coping 29 Jul 2020

    I’ve started to add a daily coping tip to the SQLServerCentral newsletter and to the Community Circle, which is helping me deal with the issues in the world. I’m adding my responses for each day here.

    Today’s tip is to get back in touch with a supportive friend and have a chat.

    While I was feeling a little down recently, as I wrote yesterday, I tried to get some connection with others. I reached out to a local friend, to try and schedule a lunch and get some support. We ended up talking on the phone for nearly an hour, which put me behind at work, but it was a good break and just talking through things was good.

    I’m glad I did it, and while I often reach out to others to offer support, I’m glad I reached out to ask for some this time.

  • Better Garmin Data Backup with MapMyRun

    I don’t know that I want to do this every day, but it’s good to know I can grab my Garmin workout data and save it elsewhere. While Garmin was having issues, I went on a test walk with my dog. Actually, a therapeutic walk as she’s recovering from surgery. In any case, I did a short one, tracking the activity. While it didn’t upload, I did back up my data.

    As of a few days later, Garmin still wasn’t syncing data, but I found that MapMyRun will accept the data. After seeing someone else note Strava and other services accept Garmin data, I decided to test it out.

    On the main page, I usually do a “Log my workout” and manually enter some data after each activity. I’m not looking for details, just the date, activity, and duration. I don’t worry getting too specific. However, I noticed there is an “Import” to the right.

    2020-07-27 09_18_35-MapMyRun

    If I click that, I see a few services listed. The one I want is the “Import Workout” button (again).

    2020-07-27 11_50_07-MapMyRun

    When I click that, I get the option to pick a file.

    2020-07-27 11_50_14-MapMyRun

    I uploaded my file, and I see lots of data, including the route and altitude info overlaid with my heart rate.

    2020-07-27 09_14_17-Walked 0.11 mi on 07_24_20 on 07_24_2020 _ RUNNING Training Log Entry _ MapMyRun

    I may have to try doing this with a few other workouts and see how they do. While entering a little data isn’t bad, it might be nice to see my heart rate over here across time, just in case I have some sort of other issue with Garmin.