Tag: syndicated

  • SQL Source Control Link Errors on a New Machine

    I replaced my desktop recently and installed new software through Chocolatey.. One of the things I installed was git. I ran “choco install git” and then started using it. I cloned some repos and everything seemed fine.

    Then I cloned a repo of a SQL Source Control database, created a new database and tried to link the repo. I got an error on screen, which I forgot to screen capture. The error was 128, which wasn’t helpful.

    Fortunately, I did manage to copy the error to the clipboard. I pasted it in Notepad and saw this:

    2020-05-14 14_29_25-Are you a gatekeeper_ - Evernote

    Aha!

    I never configured git. Since I’m mostly working in my own repos, committing back to places that I will access from another machine, I haven’t thought about this. I know I’ve done this on the previous machine because SQL Source Control worked a month ago.

    What’s nice about git, and what I wish more software did, is that it tries to help you. In this case, it tells me that it can’t detect an email address and therefore can’t populate the commit metadata.

    What do I do?

    Run the commands and config my environment. I copied and edited the commands in a command prompt. And typo’d things one time.

    2020-05-14 14_34_24-cmd

    Once this was done, SQL Source Control worked.

    2020-05-14 14_35_06-Link to source control created

    SQL Source Control is a fantastic way to easily grab your database code and put it into a repo. Give it a try today if you never have tried it, but you’ve ever scripted out your object code.

  • Daily Coping 19 May 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 take a positive action to help in your local community.

    This is an interesting one. What can you do in your community? You can help someone, or try to help a lot of people. It’s could be a lot of work, or a little thing. I chose a relatively little thing.

    When I saw Tim Radney and Paul Randal printing ear savers, I was intrigued. I’ve been tempted to buy a printer, but honestly, I don’t have time to mess with it, and don’t need another hobby. Between trying to take care of myself, helping on the ranch, cooking for the family, and then spending time with family, I’m a bit worn out. In fact, I’m as busy as I’ve ever been.

    There is a nurse that comes here for lessons, and I chatted with her one day about wearing a mask all the time. She’s used to it, but was interested in ear savers. I pinged Tim and he sent me 6, which was incredibly generous. I gave them to my nurse friend, and she really liked them. I decided to donate more.

    This time, I contacted Paul Randal, mostly because he reached out on Facebook, noting he is looking to continue donating more. I sent him a donation and put in a request for 100. I’m looking to give some to my nurse friend to spread around, but I’m also giving them our randomly at grocery stores, since those people are wearing masks constantly as well, and I can see they sometimes struggle.

    Not sure how much of a difference it will make, but it’s something.

  • Daily Coping 18 May 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 look around you and notice five things you find meaningful.

    Easy for me. Or so I thought. I wasn’t quite sure what meaningful might me for things, but I saw the definition: “having a serious, important, or useful quality or purpose.”

    Lots around here that is meaningful.

    This trailer is useful and has a lot of purpose. It helps us feed every day and keeps horses healthier.

    20200124_104415

    This guitar challenges me, pleases me, and entertains me. It has become a part of my life.

    20200428_194625_HDR

    This sprayer, since repaired, helps me care for our property.

    20200429_170550

    I’ve never been one for many neck or face coverings. Even while skiing, I wear less than the family, but I’ve been keeping masks and bandanas in the cars. They are useful, and for now, important.

    20200417_173626

    Useful, but also important in that these dishes and utensils are how I feed the family and gather them together. They help me enjoy cooking, and give the family time together. Not to mention the power, joy, and necessity of the food itself.

    20200328_194300

  • SQL Prompt Fixes Missing Begin End in Procs

    SQL Prompt is a fantastic coding aid, but it does more than format your code and provide intellisense. Over time, the team has enhanced SQL Prompt to also guide you along and fix some bad code that your team might write out of habit.

    SQL Prompt 10.1 released recently, and one of the recent fixes is for an issue that we’ve denoted as ST003. This is an issue where a procedure is not enclosed in a Begin  End. Here’s an example.

    I started writing this proc, which looks normal. I’m not sure what isn’t being qualified with the red squiggles, as the query runs fine along. In any case, I do have a green underline on CREATE PROCEDURE, which let’s me know of a style issue.

    2020-05-08 10_04_59-testquery1.sql - ARISTOTLE_SQL2017.Sandbox (ARISTOTLE_Steve (58))_ - Microsoft S

    If I put the cursor on this line, I see the lightbulb in the left margin. Since this is available, I know I have a possible “fix” that SQL Prompt will handle.

    2020-05-08 10_06_39-testquery1.sql - ARISTOTLE_SQL2017.Sandbox (ARISTOTLE_Steve (58))_ - Microsoft S

    If I click this lightbulb, I see a few options.

    2020-05-08 10_06_46-testquery1.sql - ARISTOTLE_SQL2017.Sandbox (ARISTOTLE_Steve (58))_ - Microsoft S

    The top one is the one I want. When I click that, SQL Prompt will reformat my query and add the BEGIN and END.

    2020-05-08 10_06_54-testquery1.sql - ARISTOTLE_SQL2017.Sandbox (ARISTOTLE_Steve (58))_ - Microsoft S

    This can be controversial, as the END doesn’t stop things from being included in the procedure. For example, if I do this:

    2020-05-08 10_08_48-testquery1.sql - ARISTOTLE_SQL2017.Sandbox (ARISTOTLE_Steve (58))_ - Microsoft S

    I get this:

    2020-05-08 10_09_09-testquery1.sql - ARISTOTLE_SQL2017.Sandbox (ARISTOTLE_Steve (58))_ - Microsoft S

    The CREATE PROCEDURE needs to have the batch end to stop including code. The END doesn’t do this. Make sure you have the habit of ending your procedure creation with the batch separator (GO by default).

    If you haven’t tried SQL Prompt, download an eval and see what you think. If you have it, upgrade and ensure you have all the code fixes.