Tag: Redgate

  • Have you tried DLM Dashboard?

    DLM Dashboard is a new product from Redgate Software that’s free. Free as in beer, which should be attractive to many of you. The product is in Beta, but it’s fairly stable and has worked well for me. It’s still maturing, and we’re certainly looking for feedback on what works and what doesn’t.

    What Does DLM Dashboard Do?

    There are a couple of things DLM Dashboard does that I think many of you are interested in. Both of these promote DevOps collaboration, and I’d like to see these concepts take hold in most organizations.

    1. Track changes to Production
    2. See changes coming through Development

    There’s more to the dashboard, but essentially it works by tracking the version of the schema in all environments. If anything changes, then you get an alert on the dashboard (and email notification if you need it).

    That’s it. The versions are what you call them. You can set up versions as numbers (v4.2, 4.21, 4.22. 5.3, etc.) or you could do it by deployments (Mar 3 2015, Apr 6, 2015, etc). Whatever works for you.

    The Dashboard lets you know if it detects a change and the version is incorrect, or if it detects a known version that’s been deployed to a new environment.

    I’ll describe it more in other posts, but for now, check it out. It’s free, and it’s worth a few minutes of your time to try.

    Download DLM Dashboard

  • A New Use Case for SQL Prompt – Shrinking Code

    I work for Redgate and write about products. I’ve got a series of SQL Prompt posts here on little things I like. SQL Prompt might be my favorite tool.  SQL Prompt will be yours as well if you give it a try.

    I thought this would work, but I wasn’t sure. I saw some code the other day like this:

    DECLARE @char AS CHAR(1); SET @char = NULL; SELECT ISNULL(@char, 0); SELECT COALESCE(@char, 0); SET @char = E; SELECT ISNULL(@char, 0); SELECT COALESCE(@char, 0);

    I dropped it into SSMS, and of course, I couldn’t read much of it. I did a quick CTRL+K, CTRL+Y and it looked like this:

    DECLARE @char AS CHAR(1); SET @char = NULL; SELECT ISNULL(@char, 0); SELECT COALESCE(@char, 0); SET @char = E; SELECT ISNULL(@char, 0); SELECT COALESCE(@char, 0);

    Yeah, SQL Prompt. In addition to reformatting as I prefer, it removed the extra whitespace.

  • Speaking at SQL Saturday #389 – Huntington Beach

    I’ll be traveling to CA next month for SQL Saturday #389 – Huntington Beach as well as a Red Gate DLM training session run by Ike Ellis. I’m assisting Ike in running a Database Continuous Integration class. It’s a paid for event, but you’ll learn how to set up and run a CI process with your database.

    Come.

    CI is all the rage and companies are improving their development processes, building applications faster with it. We go into depth, using Red Gate tools, on how you can get your database development working in a CI environment, and integrate it closely with your application development work.

    I don’t have details on my SQL Saturday session, but that should be coming soon. I will do a Red Gate presentation during lunch, so if you want to know how we can help you or have questions, come by at lunch.

  • Data Generator – Limiting Values

    This is a series on SQL Data Generator, covering some interesting scenarios I’ve run into. If you’ve never tried it, SQL Data Generator is a part of the SQL Toolbelt. Give it a try today with an evaluation today.

    I needed to generate some data for some development work on the SSC database. No, I’m not allowed to change code directly, but I was looking to send some changes to the development team, already done, and then hopefully just have them test and deploy it.

    In my case, to avoid exposing any real data in case of issues, I downloaded the schema only to my laptop. The I created a database with all the objects. One of my first areas of work was on the points and scoring systems, but to do that, I needed points.

    sql-data-generator-150

    I fired up my copy of Data Generator, let it detect the objects, and pre-populate the fields and clicked “Generate Data”. That worked well, and I had a bunch of data in my system.

    pointsgenerator_c

    My first area of work was to rewrite some procedures that perform calculation. I did that, ran a simple SUM, and got this:

    Msg 220, Level 16, State 2, Line 3
    Arithmetic overflow error for data type int

    Not what I expected. I just generated some data and ran a sum. What could be the issue?

    It turns out that the default settings for integer columns are shown here:

    pointsgenerator_b

    That’s great if you want a random distribution, but it’s not so good in this case. The points values I want to store for each row should be fro 1 to 7, and randomly distributed. I’d actually like them to be weighted towards 1 and 2, but for this project, it doesn’t matter.

    I decided to fix things by first deleting all the points data. Once this was done, I could then select the table on the left, and select the column.

    pointsgenerator_d

    This changes the right panel to the specific settings for this column. I changed the values, as you can see here, to be more in line with my needs. Only values from 0 to 7 are included.

    pointsgenerator_e

    I could actually use different settings for different columns. For example, for the PointsCategory column, I used these settings, from 1 to 1,000.

    pointsgenerator_f

    With these new settings, I generated new data for this table, and then my aggregate calculations worked.

    Data generation is a very handy thing to have, especially in development environments where you don’t want live data. In my case, while I think my systems are fairly safe, I’d hate to lose my laptop, with a copy of the SQLServerCentral database and a million emails that people might not want shared.