Category: Blog

  • Reminder: Extending DevOps Practices to SQL Server Databases with Redgate

    I’m hosting a  new webinar on the DLM tools from Redgate Software and database DevOps. Tomorrow, Tues, Jan 17, at noon EST, Arneh Eskandari, a great sales engineer, will be demoing the tools and techniques to deploy changes.

    You can register here and I’ll talk to you on tomorrow.

  • The Top 20 SQL Toolbelt Tips

    Redgate produces some great software, and I’m glad that I get to use all of them as a developer and DBA. I use many of the tools each week, some daily, but I constantly find that there are plenty of features, tips, and tricks that I don’t know about.

    At SQL in the City last year, I watched Tom Austin present a session where I learned a few things that will make me more productive.

    The one that I need to start incorporating into my work is looking for all the references to an object with SQL Search. A quick check means that I won’t commit changes without considering all of the other objects impacting by development,

    Watch all the tips below.

  • New Video Cards

    When I want to upgrade hardware, I usually turn to Glenn Berry for advice. He’s the person I know that really watches, examines, and evaluates computer hardware. He gives good advice and upgrades often, so he actually uses the latest hardware.

    One of the upsides of his hobby is that he is regularly replacing hardware. That means he regularly has older hardware. A few times I’ve asked for advice, I’ve actually ended up buying the previous generation from Glenn because he’s already upgraded. That works out well for me, since I don’t look to be on the latest and greatest.

    Recently we had lunch and Glenn offered me his old Radeon R9 video card. It was ranked quite a bit higher than the GeForce GT 740 I bought last year. I didn’t need a replacement, but the price was right, and maybe I’d impress my kid a bit with the upgrade.

    I went to lunch, and got a nice, geeky gift bag.

    Photo Jan 13, 10 35 25 AM

    Inside was not one, but two video cards. Apparently Glenn’s MicroCenter Outlet was having a special.

    Photo Jan 13, 10 35 33 AM

    The cards are on my desk as I need to some time to open up my case, replace cards, and then ensure everything comes back up correctly. I’ll need drivers, and no pressure to complete things quickly.

    Hopefully I won’t need a new power supply, though I am tempted to get another monitor with all this horsepower and give Twitter and Spotify their own displays. Winking smile

  • Do I have a Database Master Key in a database? #SQLNewBlogger

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

    How can I tell if I have a Database Master Key in a database? It’s actually easy. I query the sys.symmetric_keys DMV for data. If I get a result that has a name of ##MS_DatabaseMasterKey##, then I have a database master key.

    You can see this below. I’ve queried this DMV in my Sandbox database.

    2017-01-11 12_21_55-SQLQuery1.sql - (local)_SQL2014.Sandbox (PLATO_Steve (59))_ - Microsoft SQL Serv

    Now, what if I go to another database, say the Finances database. I see nothing.

    2017-01-11 12_22_34-SQLQuery1.sql - (local)_SQL2014.Finances (PLATO_Steve (59))_ - Microsoft SQL Ser

    Let’s add a master key here and then query. Note, I am not disclosing the real password here. Never do this, even in test systems.

    2017-01-11 12_23_14-SQLQuery1.sql - (local)_SQL2014.Finances (PLATO_Steve (59))_ - Microsoft SQL Ser

    This instance has been used with TDE, so if I go to master, I’ll get this:

    2017-01-11 12_24_20-SQLQuery1.sql - (local)_SQL2014.master (PLATO_Steve (59))_ - Microsoft SQL Serve

    You can see that I not only have a DMK, I have a Service Master Key (SMK), which protects the instance.

    When I create my DMK, the only parameter I can provide is a password, after the optional “ENCRYPTION BY PASSWORD” keywords. I don’t name it, so I can count on the naming being fairly consistent. I don’t think that the name would change from version to version, but it could.

    I’d prefer that MS not create magic numbers or names, and instead, add a column to the DMV that denotes this is a DMK.

    References

    sys.symmetric_keys – https://msdn.microsoft.com/en-us/library/ms189446.aspx

    CREATE MASTER KEY – https://msdn.microsoft.com/en-us/library/ms174382.aspx

    Connect Item to add a flag – https://connect.microsoft.com/SQLServer/feedback/details/3118588