Tag: Redgate

  • The DBA Team Wants You!

    We’re looking for a few good DBAs. Actually, we’re looking for a few DBAs that wouldn’t mind sharing some of their human frailty and submitting the worst day they had as a DBA. Grant and I will be judging the entries and we’ll pick one to be the theme for our Christmas edition of the DBA Team.

    Don’t worry, we won’t make you ride a horse, but we’d like to feature you by name as we “enhance” your story with a few small additions. Perhaps you’ll be driving a fancy car, or be dressed to the nines. We might even have you performing a stunt or two.

    It won’t be pretty, probably not too flattering, but it should be fun. I haven’t heard if we will give out prizes to the top entries, but the winner will be relaxing Not Only SQL style in the sun, with a free ticket to SQL Cruise 2015.

    This contest should be some fun, and all it takes to enter is a little humility, a recognition of your mistakes, and a good sense of humor. If you’ve had a bad day, enter your submission and cross your fingers. And if you haven’t clicked through any of the links, you might want to. They make this editorial much more interesting.

    Steve Jones

    The Voice of the DBA Podcast

    Listen to the MP3 Audio ( 1.7MB) podcast or subscribe to the feed at iTunes and LibSyn. feed

    The Voice of the DBA podcast features music by Everyday Jones. No relation, but I stumbled on to them and really like the music.

  • Continuous Database Delivery from the Command Line

    I’ve been working with Red Gate to learn more and the different ways in which we can help you ease and smooth the database deployment process. I know that I’ve dreaded deployments to production in most of my jobs, and only enjoyed them in one. The mission of one of the teams at Red Gate is to make this easier and easier and I’m learning about how they do that.

    They’ve also been working with many others in the world of software, providing them with tools, getting feedback, and learning from their experiences. One of the people that has done some work with our tools is Matt Whetton, and he wrote a piece on how he’d gotten SQL Compare to work with his version control system (VCS) to get a Continuous Integration (CI) process in place. He’s using TFS, as many of you are, though he has the SQL Source Control plug in to SSMS to make managing his database code easier.

    I won’t duplicate his process here, though it’s one that should work well. It has lots of pieces and parts, and might seem confusing, but it’s not. He describes in detail how he runs tools from the command line to build a more automated process. If you want us to do more of the work, we have an automation pack to smooth the entire process, and we’re improving it all the time.

    I would encourage you to think about building your own automated process for database changes. It might seem like adding work for no good reason, but it can pay off as you expand the process through later environments to deploy to QA, Staging, UAT, Production and any other environments you might need to. If you move to the cloud, having automated processes become even more important.

    You can also take a look at the Red Gate “Learn more about databass delivery and continuous integration” page.  We’ve got some resources up there and are looking to add more all the time.

  • Quick Tips–SQL Prompt Custom Aliases

    I love SQL Prompt, and think it’s a great productivity tool. Even before I worked at Red Gate, I love the tool and had a copy before Red Gate bought the technology from the original developer. Recently I’ve run into a few people that weren’t aware of some of the ways in which it can help you. This is a quick look at one of the ways I use SQL Prompt.

    Custom Aliases

    SQL Prompt can automatically create aliases for tables. However, as I’ve worked on different systems, I’ve often found that development teams like to use specific aliases consistently to ensure that everyone can easily read the code and understand which tables are being queried.

    Suppose I decide that I have these tables:

    • Product
    • Product Details
    • Orders
    • OrderDetails

    I often use these tables in queries in my system, and I want to have consistent aliases. Right now, I could have these two queries with the default SQL Prompt alias settings:

    aliases20

    Note that the Orders table has “O” as an alias in the first query, but “O2” as an alias in the second query. This isn’t an issue when I’m writing a query, but when I revisit this code in a month or two and add an enhancement, it can be tricky.

    What I’d like to do is ensure I had consistent aliases for my tables, so that every developer always knows that “o” is Orders and “od” is OrderDetails. I want these aliases

    • Product – P
    • Product Details – PD
    • Orders – O
    • OrderDetails – OD

    I can do that in SQL Prompt with custom aliases. Let me go back to the Options dialog and select Aliases.

    aliases_21

    I’ve already added an item in the Custom aliases section for the product table. However I can click New (highlighted above) and I’ll get a little dialog.

    aliases22

    I repeat this process for each table, and soon I have all four entered.

    aliases_23

    Now I can rewrite my query. I start typing each table, and once it’s highlighted, click “tab”. When I get done, I have:

    aliases_24

    A quick way to ensure that all of your tables are consistently aliased, no matter in which order you type things.

    aliases_25

    You can see a complete list of SQL Prompt tips at Redgate.

  • Quick Tips–SQL Prompt Aliases for Every Table

    I love SQL Prompt, and think it’s a great productivity tool. Even before I worked at Red Gate, I love the tool and had a copy before Red Gate bought the technology from the original developer. Recently I’ve run into a few people that weren’t aware of some of the ways in which it can help you. This is a quick look at one of the ways I use SQL Prompt.

    Aliases

    Aliases are used to make code more readable, and shorten the amount of code that one needs to write. Typically we use these to give a short name to a table. Instead of:

    aliases_12

    We could use an alias. Note the “p” after the table below and the change in the column list.

    aliases_13

    Automated Aliases

    SQL Prompt can automate aliases for me. Under the Options dialog, there is an Aliases selection (shown below).

    aliases_1

    Note that I’ve checked the “Assign Aliases” box. This is not checked by default, but once I check it, I get aliases. Let me write a query.

    aliases_3

    I’m about to select my Orders table from the Prompt drop down. Once I click Tab, I’ll get this:

    aliases_34png

    SQL Prompt has added the alias for me. It’s a lower case “o”. If I add another table:

    aliases_5

    I hit tab at this point and I get:

    aliases_6

    I have a new alias of “o2”. Not terribly creative, but it works.

    I have some options for changing these around. Suppose I want to make these upper case to stand out. I can change this in options:

    aliases_2

    Now I add a third table:

    aliases_7

    I hit tab:

    aliases_8

    My new alias is an upper case “P” for the Product table. That gives me a bit of differentiation for my tables.

    I, however, do not like the “AS” keyword. I typically just space my alias after the table. I can change that in options:

    aliases_9

    I’ve unchecked the box and now I add a new table.

    aliases_10

    When I hit Tab, I’ll get a new alias, upper case, but no AS.

    aliases_11

    These are not terribly intuitive aliases, but this does at least clean up your code a bit, so when you see all the column names they aren’t spread way to the right with table names like “ProductDescriptions”.

    aliases_14

    You can see a complete list of SQL Prompt tips at Redgate.