Author: way0utwest

  • Who’s Licensed?

    My employer licenses software to users. Many of you might have SQL Compare, SQL Prompt, or one of our other handy products. If you do, you might have noticed that we have a Redgate login for you that shows your licenses and lets you activate/deactivate them. This was surprisingly a big project across the last year to streamline and smooth our licensing process.

    Early on, I realized this was an issue in one company I where I worked. This was during the 1990s and I started working at a small company with a fancy imaging system. We had purchased software to receive all our faxes as images and file them in a digital system. I’m sure we had one of the smallest (and cheapest) installations of this software, which one of our executives had managed to negotiate. However, the exec had left the company and a few months into my tenure, I needed support.

    Finding our account, verifying our status, and re-enabling an old email account were a few of the cumbersome steps we completed to link the software to our organization. As soon as this was done, I realized this process had created a single point of failure, something I’ve tried to avoid as a technology professional. Immediately I set up a new email (licensing@ourdomain.com) and changed our account to this email. In fact, in all future purchases of software and hardware, I linked all support, warranty registrations, purchasing contacts, and more to this email. I also had this email forward to both myself and the CFO (he got an email rule set up to file this away).

    Since that time, I’ve tried to use centralized contacts for my employers, ensuring that any vendor contact would outlive my tenure. I haven’t always been consistent, and certainly with SQLServerCentral, I purchased any number of things under my own email, assuming if I weren’t there, the company wouldn’t be. However, I did make sure that I put all contact info in a Password Safe that my business partners had copies of.

    I wonder how many of you bother to worry about longevity when you contact a vendor or purchase software. There are certainly times when a personal email makes more sense (research, working to craft an ROI), but for formal contacts, and registrations, a more generic contact might make sense.

    Actually, I’d like to see more vendors take this approach, building their CRM and sales systems to take a general contact and then a list of individuals that might be personal contacts. They could easily add new licenses to this account, tracking them in a central area, perhaps even ensuring that renewals would be a more efficient process.

    Steve Jones

    The Voice of the DBA Podcast

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

  • Checking Your Database Properties–#SQLNewBlogger

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

    I was reading Grant’s Database Fundamental Series on Database Properties, and it got me thinking. I think this is a good set of knowledge to have, but building on the properties, can you check them programmatically?

    You can, and here’s how.

    There is a function, DatabasePropertyEX(), that provides you a way to check properties.  You can use this with two parameters to check your database. These parameters are:

    database name – The name of the database, where you can use dbname() for the current database.

    Property name – These are a series of items to check a value for.

    As an example, one of the items Grant mentions is the recovery model. I can check that with this code:

    SELECT DATABASEPROPERTYEX(DB_NAME(), ‘Recovery’)

    In the current database, I get this:

    2017-07-27 14_31_24-SQLQuery8.sql - (local)_SQL2016.TestingTSQL (PLATO_Steve (52))_ - Microsoft SQL

    There are many properties I can check, and I can see a nice list here from SQL Prompt, or I can check the BOL page.

    2017-07-27 14_31_59-SQLQuery8.sql - (local)_SQL2016.TestingTSQL (PLATO_Steve (52))_ - Microsoft SQL

    As nice as it can be to pop open SSMS and look at dialogs, learn to check things programmatically. Once you can do that, you can start to let the system check and alerts you to changes.

  • Data Science en Masse

    GE is an amazing company. They seem to have so many divisions and produce a wide variety of products. Their financial investment success amazed the world and made Jack Welch an icon to many businesspeople. I remember reading about revolutionary management techniques at one of their jet engine plants that dramatically increased efficiency and performance of that location, similar to the ways that DevOps can produce better software. They have transformed the company from light bulbs to televisions to nuclear power and more across the decades.

    And they’re not done yet. GE is building a workforce for the 21st century, teaching many of their employees about data science and machine learning. The company is working to retrain scientists and help them explore new ways of using AI techniques to build better software. There are machine learning and data analytics courses available to employees, with the aim of creating hybrid employees that add digital skills to the knowledge they already have in other areas.

    Why is GE looking to transform it’s workforce with data science skills? They are creating AI software for their products and hoping to expand this further into more areas. With the competition from many other vendors, the ability to generate better results for clients, even just slightly better, might be enough of a differentiator to allow them to continue to grow as a leading industrial company.

    Would this work for your company? Your import organization, service company, retail business? Perhaps. Machine Learning isn’t perfect and doesn’t produce the best decisions, but if it can slightly improve the performance of your organization, perhaps it’s worthwhile. Microsoft is certainly making some of practical elements cheaper with the easy to use with new products, such as Azure Machine Learning.

    The challenge is that this is just the final element. Your company still needs someone that has built some knowledge of the deep mathematical concepts behind machine learning and has spent quite a bit of time experimenting with your data, building models and determining the relevant features needed. Preparing and loading data is also a challenge, which is why I think one of the core skills future data professionals need is the ability to quickly and effectively build ETL pipelines. If you can get those things done, a tool like Azure ML might be just the thing to add a few efficiency (or profitability) points to your bottom line.

    Steve Jones

    The Voice of the DBA Podcast

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

     

  • MSBuild and Azure SQL Database

    I saw a report of a problem building a database with ReadyRoll in Azure SQL Database. This person wanted to use a local Shadow database in LocalDB and target an Azure SQL Database. I hadn’t build that config, so I decided to give it a try.

    Update: ReadyRoll has become SQL Change Automation,and this no longer applies. Contained users are supported with SQL Change Automation projects, which will solve this issue.

    I ended up with this:

    2017-07-20 10_56_01-builds_azure-CI summary

    which was making me a little crazy. I’ve had most builds work really well. I tried a number of things, but kept getting a few items in the build. There were login errors or network errors, both of which bothered me since I could manually log in with SSMS from the same machine as my build agent.

    I suspected a few things here, one of which was the use of named pipes for the Shadow database and TCP for Azure SQL Database.

    Eventually, I decided to fall back with msbuild, ignoring VSTS, and make sure all my parameters were correct. I started here:

    C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild builds_azure.sqlproj /p:TargetServer=”dkranchapps.database.windows.net” /p:TargetDatabase=”SSBuilds” /p:TargetUsername=”dlmdeploy” /p:TargetPassword=”astrongpassword” /p:ShadowServer=”(Localdb)\ShadowSSBuilds7″ /p:GenerateSqlPackage=True /p:SkipDriftAnalysis=True /p:ShadowUsername=”shadowuser” /p:ShadowPassword=”someotherpassword”

    I promptly got a VS build started and then this error:

    C:\Program Files (x86)\MSBuild\ReadyRoll\ReadyRoll.Data.Schema.SSDT.targets(513,5): error : An error occurred while attempting to
    create a patch script: Login failed for user ‘dlmdeploy’. [E:\Documents\Visual Studio 2015\Projects\builds_azure\builds_azure\buil ds_azure.sqlproj]
    Done Building Project “E:\Documents\Visual Studio 2015\Projects\builds_azure\builds_azure\builds_azure.sqlproj” (default targets)
    — FAILED.

    I verified the password in SSMS, verified the firewall and tried again. Same issue. Then I tried this:

    > sqlcmd -S dkranchapps.database.windows.net -U dlmdeploy -P “AStrongPassword”
    Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : Login failed for user ‘dlmdeploy’..

    Hmmm, that’s interesting. Why would this work in SSMS and not SQLCMD? My first thought was some driver setting, maybe ADO v ODBC, but that seems silly.

    Eventually I suspected some mismatch in databases, and found this post. It confirmed what I was about to test. I needed the same login/password in the master db as in the particular db I was using.

    I used SSMS and connected to master to create a user there.

    2017-07-20 11_06_42-SQLQuery5.sql - dkranchapps.database.windows.net.master (sjones (112))_ - Micros

    Once I did this, the build ran fine, both in the command line and in VSTS.

    A couple lessons here. First, in Azure, you connect to databases, but since some processes (like MSBuild) might connect to a default, you need the user in your db and in master. If you have multiple databases (as I do), I’d suggest separate accounts for building in each db.

    Second, work with the command line first. That’s the key. Once you have things working from there, it’s easy to move to a tool and automate your command line instructions.