Saturday, September 14, 2019

Good to see you at Houston Tech Fest 2019!

It was awesome to see a great crowd at the triumphant return of Houston Tech Fest 2019. This year's event was hosted at the beautiful Microsoft Office in Houston. Thanks to everyone who joined my presentation on SQL Server Permissions and Security Principals 101 after the lengthy lunch break and learned all about SQL Server permissions, starting with the basics and moving into the security implications behinds stored procedures, views, database ownership, application connections, consolidated databases, application roles and much more.

You can download the slidedeck here:

and reference the toolbox here:

Thanks again to the host employees at the Houston Microsoft Office for opening their doors on the 10th floor to a wide variety of area tech professionals. I met database administrators, sysadmins, Agile Scrum masters, recruiters (even someone looking for a LAMP developer), students, jobseekers, IT managers, and more.

Thursday, September 12, 2019

SQL Security Principals and Permissions 101 at September '19 BRSSUG

Great attendance and great meeting last night for the September '19 BRSSUG meeting, great to see lots of new faces at the meeting following our successful SQLSaturday event in August.

My "SQL Security Principals and Permissions 101" presentation is a ground-floor introduction to SQL Server permissions starting with the basics and moving into the security implications behinds stored procedures, views, database ownership, application connections, consolidated databases, application roles and much more. This session is perfect for junior DBAs, developers and system admins of on-prem and Azure-based SQL platforms.

You can download the slidedeck here:

and reference the toolbox here:

One note to add for other presenters: this presentation is broad enough to be long-lived. I originally developed this presentation in 2011, but many of the topics are just as relevant today as they were 8 years ago, even though I've added a large amount of Azure content, a section on SQL Injection, and have added/removed a slide or detail here and there for time. Continuously developing a 101-level,  topical presentation like this has been a great driver for my own ongoing education and technical reading. Between this and some other broad topic presentations like my Admin Best Practices with  DMV's presentation, I'm regularly making myself notes on new (or new-to-me) facts and tips to add over the years. I recommend this approach to new technical speakers!

Wednesday, August 21, 2019

My Organizer's Notes and Goodbye after #SQLSatBR 2019

Some 2019 tips for other SQLSat organizers from my last year as lead organizer of SQLSatBR. I hope as a fellow organizer, you can pull some ideas and inspiration for your future events!
  • Last year we tried to take an "action" pic of each sponsor booth. We sent a personal email and included those photos to the sponsors this year, with an email "We'd love to have you back at SQLSaturday Baton Rouge 2019!" This year, we included action shots from Saturday in our "thank you" email that also included the scanned raffle badges for those sponsors. It worked to renew a sponsor in a couple cases, and we received some really nice replies to those emails. Examples:

  • Always capture booth "action" photos, of conversations taking place and with big crowds in the background/foreground. Use them as great call-outs on social mediaBig crowd shots are always winners, tell your photographers! Then, we post all our photos in a shared community photo album for anyone to contribute.
  • Our Thursday night bag-packing event was just so impressive. Notice our double-barreled, assembly-line approach to packing 500 bags in <2 hours. We also packed our third annual speaker goodie bags as a team that night, which was nice, since I'd done that on my dinner table in past years. 

  • In an effort to reduce waste and our landfill impact, we bought biodegradable badge holders this year instead of the slightly cheaper PVC badge holders which are worn once, tossed in a landfill forever. (Biodegradable plastic badge holders aren't as common to find, we bought from and they worked fine with the SpeedPASS PDF name badges that are 4" wide.) We also had our vendor use biodegradable paper-based serving boxes for the lunches instead of standard styrofoam. 
  • Be sure to recognize your user group and host facility partners, offer them a special place in the sponsor lineup. We were fortunate in a position to offer both the La. Tech Park and LSU a free booth at our event, as a big thank you for the free host facilities they provide us year after year. We also reached out and provided free booth space to the local Toastmasters group and a nonprofit that offers STEM education to low SES kids in our city.  But it's important that we make sure to reach out and offer our host facilities some recognition and an opportunity to participate, rather than just a transactional facility rental.

    Especially if your host is a higher education facility that provides post-grad certificates or degrees, which are major revenue sources, they would likely appreciate an opportunity to staff a booth and get their pitch out. This type of relationship is the type that leads the school to give us the facility for free, because the department is "hosting" our event rather than renting us rooms, so we bend over backwards to thank them.
  • We plan on expanding the use of facilitated panel discussions next year, they have been the past three years well attended and an additional honor to speakers and community partners including new potential sponsors. This includes the CIT Panel that we've done for years in partnership with Careers in Tech and our CIO Panels in the past. 
  • Feedback from Kenny Neal, our amazing schedule master: "If we could get a drag and drop scheduling module for it would be great. Like a listing of approved sessions on one side and let me drag them where I want them." Our schedulemaster was otherwise very happy with the new features on the admin SQLSaturday site this year. Gotta keep them happy. Big thanks to all speakers who spoke multiple times, some on short notice, and some three times back-to-back-to-back. Speaker dropouts are always a reality and easy to overcome when you have an diverse, experienced speaker lineup from around the country. Our strategy is to accept single sessions from as many distinct speakers as possible, and then add second sessions from their repertoire as needed.
  • Our Friday sponsor/speaker/volunteer dinner featured live music from the jazz band led by one of our long-time volunteers and a local data professional, Lori St George. Honestly it exceeded all expectations and Lori's Collaboration Band was a huge hit. It was an amazing collection of musical genius until they brought some of our SQLSatBR organizers up on stage for a hard-working finale.

    Are there any fun music acts in your local SQL community? Pro tip: don't ask them to play for free. Don't ask any independent/freelance folks to do what they do for free. We paid our tee shirt artist for design time, our band (no website for them... yet), our user group logo designer, and the baker of our pralines and bread pudding. If someone wants to volunteer their time, great, but if you're asking them for their normal services offer to pay their normal rate.
  • Blown away by all the people who participated in our small remembrance of SQLSaturday volunteer photographer and Baton Rouge community volunteer Carter Spade. Carter tragically passed away in July, leaving a void in many volunteer organizations like ours. Thanks for joining us in that, friends. Thanks for all your help in years past, Carter.
  • Our second year of a STEM Kid's Track was a hit. I visited the classroom after lunch, and the 30 kids in there were actively typing, plugging away, smiling and laughing, planning and debugging, and definitely the opposite of bored. Produced by the Foundation for the EBR School System, it sold out really fast despite being greatly expanded. There were definitely some disappointed parents. Next year we plan two classrooms, and an expanded partnership with STEM educational organizations in the city including the La. Women in Technology group, who we raised money for at our end-of-day raffle, netting a total donation of $1452.

    Someone asked why a few years ago we started emphasizing, featuring, showcasing, and raising money for STEM education nonprofits like The Futures Fund. It's because stuff like this helps the event to be more than "established IT professional training established IT professionals". We cast a wider net, a wider view. I don't want to be a part of an insular same-faces-every-year cycle. That's one of the reasons I have stepped down as lead organizer of SQLSatBR, but will be around to help the volunteers ready to step up.
Why am I stepping down as SQLSatBR lead organizer? There are a few reasons, I'll explain some here. I definitely will continue to support the both our SQLSat Baton Rouge conferences in 2020 as a volunteer, as well as the SQL user groups, as well as my role as a PASS Regional Mentor. But not as lead organizer for the SQLSatBR planning committee.
  1. Organizing the SQLSaturday has been really good for me professionally and personally. I've met tons of people. I've exercised skills as a public speaker, decision-maker, organizer, logistics. I've made friends from fellow organizers and volunteers, vendors in the community. I've exercised gratefulness in making sure to thank people as often and as individually as possible. So, why shouldn't others be able to do this? Other volunteers deserve the chance to own a larger portion of the conference we've built together since 2009. The Baton Rouge SQLSat scene is great to have not only a new SQLSat BI event coming in 2020, but also a dozen folks who I think would be perfectly capable and enthusiastic about running the conference, talking with sponsorships, making sure the spending lines up with the fundraising, talking to vendors, etc.
  2. First off, we have a ton of volunteer/organizers. I have had a lot of help. I want to make sure a smooth a transition as possible happens, so while I won't be lead, I will still be around. I'll probably be speaking more, leading less. But others deserve, want, and are enthusiastic about filling my shoes. There's no better time, the table is set and a great crew of volunteers is hungry. I left with a tight throat but with no animus, no regrets, and no apprehension that this thing that I have grown and loved will continue on. It'll be different in their way, and that's OK.
  3. I'm not sure what I'll do with my freed-up time in the late summers, but I'll figure it out. Don't worry about me. My wife and I have an empty nest and many adventures ahead of us. 'nuff said.
In case I got a little too choked up on Friday night, here's the notes I printed:
Lemme talk a little about SQLSaturday Baton Rouge.
I was just bragging on Twitter about the awesome volunteers we have, literally a couple dozen people show up, new faces and old, to help pack 500 attendee bags and a few dozen speaker bags. We have an amazing venue given to us free via our partnership with the LSU College of Business and the Stephenson Department of Entrepreneurship and Information Systems. We have an artist we’ve known and trusted for years for our poster and tee shirt designs. We’ve got documents, spreadsheets, contact lists. We got shared accounts for email and docs and social media. We’ve got a UPS Store box, we’ve got a high-falootin business bank account with have a dozen card holders and hours of paperwork, we’ve got a legal not for profit corporation. We even got branding for the SQL, .NET and Analytics User Groups to share a common logo concept across all our platforms and signage. We’ve got an amazing team up here, of DBA’s, Dev’s, and Data Professionals, and Microsoft MVP’s and Microsoft employees,
, and one lead singer who is also a data professional.
, and one Oracle DBA but we don’t hold that against Kristen. 
So when I say that 2019 is my last year as lead organizer of SQLSaturday Baton Rouge, I am stepping down from that role, and this is me announcing that to everyone, everyone including my wife, I’m saying it with a high degree of confidence that this thing we’re all doing with our free time in the late summer is in good hands. I’m not vanishing, I’ll be around to help, I’ll probably speak at the event, but this team has got this and we will work deliberately to make sure we’re as successful in 2020 as we have been in the past.
So, enough from me, thank you all, please eat, enjoy the music, see you tomorrow morning.

Tuesday, August 13, 2019

See you Saturday in Baton Rouge!

See you in Baton Rouge this weekend! We have 13 tracks of professional development and training, from entry-level to expert, for SQL Server Administrators, Business Intelligence Developers, Data Analysts, ETL Developers, C#/VB.NET Developers, Mobile Developers, Windows Server Admins,
SharePoint Architects, SharePoint Developers, Network Administrators, Quality Assurance Analysts, IT Managers, Students, Project Managers, Hiring Managers, Jobseekers of all levels of experience, Students, CIO's and CEO's.

Register here:

Print your SpeedPASS PDF here:

Monday, July 29, 2019

Think Like a Certification Exam at SQLSaturday Birmingham

Thanks for joining us at SQLSat Birmingham! Had a great session with an awesome amount of participation and shared insights, including some very clever test takers.

Congrats and kudos to the organizing team for SQLSaturday Bham, John Baldwin, Samir Behara, and their team of volunteers from many different user groups. Thrilled to see that like in Baton Rouge, Birmingham is having monthly meetings with SQL, .NET, Agile, and PowerBI User Groups assembled together, a veritable supergroup of user communities that is a big draw. This really helps them (and us) gather a critical mass of attendees that helps attract sponsors, increase networking possibilities, keep regular attendees, and attract new ones. Next step? A fully integrated SQLSaturday event, with tracks populated by speakers and attendees from each technical community!

You can download my slidedeck for the presentation here:

PS How could I have forgotten that there was a cat in Alien AND in Aliens? Gah. That one snuck past my alpha and beta exam testing phases...

Sunday, June 30, 2019

Thanks for Joining us at SQLSaturday Pensacola!

Thanks for joining us at #SQLSatPensacola!

The 8:30am Careers in Technology panel featured lots of talk about Twitter, so might as well mention that the panelists were (in audience's order, left to right): @SqlrUs @SQLEspresso @mviron @svenaelterman @william_a_dba @sqllocks @SQLServerDBA318 @IrishSQL. It was the first of four back-to-back sessions for the Assafs!

Then Christine gave a presentation on Giving Feedback: How to Effectively Communicate to your Employees. I presented on SQL Admin Best Practices with DMVs in the auditorium before lunch.  Here's the slidedeck and info for my presentation. The slidedeck has also been uploaded to the SQLSat Pensacola schedule page. The lunch WIT session with Rie, Monica, and Christine was also full of wisdom and truths.

It was great to see #SQLFamily again this weekend, hope to see you next time!

Next up is SQLSaturday Birmingham, then Baton Rouge on August 17!

Monday, June 24, 2019

SQLSaturday Pensacola 2019 Coming Soon, See You There

One of my favorite (and my first) SQLSaturday events, Pensacola is this weekend June 29. Check out their lineup and info! After that I'll be at SQLSat Birmingham, then my hometown SQLSaturday Baton Rouge on Aug 17. Hopefully everyone in the region can make it out to all these great SQLSaturday events.

At SQLSaturday Pensacola, both my wife and I will be presenting, then catching up on reading and relaxation. I'll be presenting in the morning on SQL Admin Best Practices with DMVs, and she'll be presenting (a much more popular topic) for current and future leaders, Giving Feedback: How to Effectively Communicate to your Employees. I'll also be part of the Careers in IT - Pensacola 2019 panel in the first timeslot.

We'll definitely both be joining Rie Irish for Women in Tech: Thriving Not Just Surviving as well.

SQLSat Pensacola is also sporting a pair of precons on the Friday before, including Zero To Dashboard by Angela Henry and Managing and Architecting Azure Data Platform by fellow good looking bald guy John Morehouse.

Looking forward to #SQLFamily again this weekend, hope to see you there!

Wednesday, June 05, 2019

Actual Emails: Will MSOLEDB work for connecting to an Availability Group?


We need to configure an existing legacy application from an external vendor to talk to our new SQL Server 2017 Availability Group, which spans multiple subnets. In the end, that last bit is the key. The old data provider MSOLEDB will work for connecting to single-subnet Availability Group listeners, but won't work consistently when connecting to a multisubnet Availability Group's listener. The key is the ability to specify MultiSubNetFailover=True in the connection parameters.

Client's software vendor:
The connection used is the Microsoft OLE DB Provider for SQL Server that is supplied by Microsoft to create the Data Link Properties. When configuring our Data Link, we use the "Microsoft OLE DB Provider for SQL Server". The connection string is formatted: 
Provider=SQLOLEDB.1;Password="whatever";Persist Security Info=True;User ID=username;Initial Catalog=Test;Data Source=ServerName 
Good info, but we do need to make a change here. SQLOLEDB is the provider from back in the SQL 2000 era. Do not recommend its use for new development. It has been replaced by the Native Client (SNAC), which has since been replaced by MSOLEDBSQL (I linked below).  It should be easy and transparent to upgrade the provider from SQLOLEDB with no negative impact.
Here’s why we need to upgrade the data provider to talk to our SQL Availability Group. The SQL Server Listener for a multi-subnet Availability Group actually has two IP’s. When you perform at a command line:
Nslookup SQLListenerNameWhatever 
You get back an IP in each subnet (in our case, two), for each replica SQL instance in the Availability Group. 
When a connection string uses MultiSubNetFailover=True and connecting to the Availability Group Listener name (not the IP or either SQL Server instance name), BOTH IP’s are tried simultaneously and immediately, and the driver talks only to the IP that replies: the primary replica.  After a failover, the other IP begins to reply immediately, and so there is no delay in reconnectivity when a failover occurs. 
Without specifying MultiSubNetFailover=True, your application will (essentially randomly) pick ONE of the two IP’s for the Listener, and try it. There is no way to “rig” one IP to be first consistently over time. If it picks the primary replica, everything works! If it picks the IP for the current secondary replica… your application’s connection timeout will have to expire and then try the next IP.  This is why I’m bringing this up – the application will timeout upon SQL login without MultiSubNetFailover=True.
This hasn’t been an issue with your other clients if they aren’t using a multisubnet availability group. If they have an Availability Group all inside only one subnet, then the Listener only has one IP in DNS, and MultiSubNetFailover=True isn’t required.
You should be fine to install the MSOLEDBSQL provider released in 2018 and use that in your data link. Obviously it should be tested for due diligence, but it should work. At the very least, you could try instead the SQL Native Client 11 (SQLNCLI11), which was released for SQL Server 2012, and it also should work just fine for both OLEDB or ODBC.
Let me know if you have any more questions.
Connection string information for SQL Server Availability Groups:
Note: you also need to make sure your Windows Cluster has RegisterAllProviderIP's set to ON for a multisubnet Availability Group!

Saturday, June 01, 2019

Thanks for joining us at SQLSaturday Dallas!

Thanks for joining hundreds of SQL pros from around the country today at UTDallas!

Here's my session downloads from my presentation today at 1:15 in room 1.102, there's a handy .zip file in there with all the contents for easy reference. They have also been uploaded to the SQLSaturday Dallas website and downloadable from the schedule page.

Why a 101-level presentation? One of the pieces of feedback we consistently have received over the past 10 years of SQLSaturday Baton Rouge is there's not enough entry-level content. This is why I try to deliver low-level entry ramp style presentations for jobseekers, job switchers, and students at SQLSaturdays. And it's not something "beneath" me, because these foundational, fundamental principles are important for new careers and, at the edges, I still learn things that round out my knowledge and further my own career.

Thursday, May 30, 2019

See you at SQLSaturday Dallas!

Both my wife and I will be speaking this weekend at SQLSaturday Dallas, back-to-back in room 1.102, and both on topics perfect for entry level IT pros, job seekers, and students. We're honored to be on a SQLSaturday schedule filled with some of the biggest names in the industry, so I hope to see you there! Looking forward to seeing so many #SQLFamily there again.

I'll be presenting on SQL Security Principals and Permissions 101, a ground-level introduction to SQL Server authentication, security principals and even some security principles. We'll go through some code demos about how stored procedures assist the DBA by abstracting the permissions necessary for execution, and how you could design a database security model using role-based, least-permissions pattern. I think everyone can learn something from this session, from DBA's to developers, and how better to secure their databases.

See you at UT Dallas this Saturday, June 1!

Wednesday, May 29, 2019

Untrusted FK's demo + ADS notebooks

Back in 2012 at SQLSaturday Pensacola, I did a lunch-time lightning talk on indexing, which was supposed to have a big finale on how FK's could silently help with performance, and it didn't work. Didn't show the performance boost. It was because, thanks to poor scripting by SSMS, FK's are enabled but not trusted. This blog post serves as a long-belated knowledge share of a problem I didn't figure out live, as well as a successful recreation of that big finale.

Fast forward to a couple weeks ago at the May 2019 Baton Rouge SQL Server User Group, and local fellow SQL pro John Wells gave a presentation to a mixed audience of dev's and DBA's on performance tips, and one of them was to check up on untrusted FK's. Thought occurred to me to create some lab's to demonstrate not only how to untrusted FK's get accidentally created by well-intentioned dev's and DBA's, but how to fix, and also a demonstration on how they can be silent performance drags. So with all respect to John, Chris Bell who John mentioned in his presentation, and many others who have spoken and written well on the topic already, below is a lab demonstrating the issue, resolution, and performance impact.

To further one more goal, I've built the lab into a tsql script but also a new Azure Data Studio SQL notebook. Either offer a step-by-step introduction and demonstration. New to SQL Notebooks? No worries, they were released generally in March 2019 as a new feature of Azure Data Studio (which can be launched from SSMS 18+), which itself was made GA in September 2018.

A SQL Notebook is another way to combine text instructions with step-by-step, modular executed SQL statements in a single file. Notebooks are a popular form of mixed media, combining text, proofs, queries, and their live interactive output. They are already quite popular tools for data scientists to package methodology, analysis and live output. SQL Notebooks include kernels for querying SQL, PySpark, Spark, Python with multiple languages, and now in preview for SQL 2019 CTP 3.0, working with big data clusters. SQL Notebooks could also be used by DBA's and developers as rich, well-documented runbooks for complex exercises deployment or disaster recovery exercises.

SQL Notebooks are easy to learn and use, consider a SQL Notebook for your next detailed query breakdown or summary data analysis. Maybe you'll learn two things at once!

Github links to the SparkhoundSQL toolbox for the Untrusted FK's lab: .sql .ipynb

PS Check it out, Github even parses the notebook JSON correctly to display a (non-interactive) view of the notebook outside of ADS with the saved resultsets. Neat!

UPDATE: Refined my terminology a little bit to favor "SQL Notebooks" not "ADS Notebooks"

Monday, April 29, 2019

Four Data Integration Design Questions to Ask

We get requests to move data between custom systems regularly, even within systems. I was advising a client on something fairly simplea collection of tables out of one vendor system to feed anotherand I thought I'd make a blog post out of the array of questions that always come up.

Regardless of the strategy for data movement, whether it be:
  • SQL Server Integration Services (SSIS) locally or in Azure Integration Runtime (IR)
  • Stored procedures
  • SQL replication
  • Secondary readable Availability Groups
  • Azure Data Factory 2.0 (not 1.0, oh goodness, never 1.0)
  • Transactional movement featuring message queues or APIs
  • Any streaming solution
  • ETL or ELT
  • Any other kind of transformation I'm forgetting to mention
The following questions should be asked before designing a data movement plan.

(There are no correct answers to these questions of course, but you must be able to determine the answers from the business case.)

1. What is the latency requirement for the changes from the data source(s) to be copied to the destination?
Common answers: Instantly, no longer than 5 min, or 30 min, or nightly.

2. How many rows are expected to change in the source(s) in a given time period? 
Common answers: Anywhere from few rows per month to all/most the rows in a table every day.

3. What types of data changes are performed in the source(s)? 
Is the source data inserted, updated, and/or deleted? 

4. Do we have a reliable way to identify "the delta"? 
How do we know which rows have changed, including hard deleted rows (vs soft deleted rows)?

Let's dive more into the last question, because this is where the design meets the implementation method. There's a reason we always design tables with an IDENTITY column and some basic auditing fields.

First off, a truncate/insert strategy is not scalable. I have redesigned more of these strategies than I can remember, often because of database developer myopia. A truncate/reinsert strategy, even a bulk insert strategy, will inevitably outgrow its time boundary identified in Question 1. Don't waste your time and resources on such a strategy, you need to identify a way to find out what changed the in data source now.

But what if we don't or can't trust the application to always modify a "ChangeDate"? This is certainly the easiest way to know if the row has changed, but what if the original table wasn't designed with such a field? We should consider whether we can alter the data source(s) with useful, built-in SQL Server features like Change Tracking (CT), Change Data Capture (CDC), or a more recently-introduced feature called Temporal Tables. The latter can provide a reliable, built-in modified date and row history, transparent to applications. All of these strategies are well documented and have easy to use labs available.

Each of these solutions is very useful and recommended in its use case, and much preferred over a trigger-based system which will add complexity and overhead to transactions. A "pull" of recent changes is much preferred for most scenarios over a "push" of each change inside the transaction.

Caveats remain howeverand this came up with a recent clientthe impact on future updates/patches for databases must account for implementations of CT, CDC, or Temporal Tables. The same caveats apply to replication (useful in spots) and database triggers. Don't enable these SQL features without consulting with and advising the maintaining developers on the potential impact and need for testing.

One more crucial factor often overlooked as part of Question 4 are the intermediate transactions, especially in the case of less-than-instant data movement. If a row changes from status 1, to status 2, to status 3, can we just send over the row state with status 3? Or must we apply an insert for status 1, an update for status 2, and then another update for status 3 to the destination? This could be a major problem if the destination has an indirect dependency on evaluating the status changes; for example, to calculate the durations between statuses.

I once designed a data warehouse for tracking the performance of auditors, and we were analyzing the workflow for the bottlenecks in a 20-step process. Each of the 20 steps and its corresponding row state and time stamp were the whole point of the analysis. This demanded some sort of row-versioning in the data source. Not all change detection strategies work for this, however. Change Tracking, for example, would not suffice. Know your solutions!

You shouldn't move forward with any data movement design before answering these questions.

Are there any other common questions you'd ask for before deciding on a plan for a project like this?

Monday, April 15, 2019

Actual Emails: How do I learn SQL Server despite limited SQL duties at work?

Got this email from a client in the southern US asking how to up their game in SQL Server, frustrated by a lack of hands-on opportunities to administer SQL via current job duties. I also felt it necessary to discuss whether or not cert exams were appropriate, leaving it up to them, and then my preferred training methods.

To: William 

Subject: SQL Certification Questions

I am trying to gain a deeper knowledge to go and sit for the certification exams. What would be your best suggestion to immerse myself into SQL and learn the skills I need to sit for each exam. I have tried to just create tasks to force myself to learn and practice SQL query skills and that works but it has some limits. I learned a lot from that, but I learned so much more with some direction and a course structure.  I have taken a couple of online SQL training courses and everything seems simple and logical. I start feeling like less confident when I look at sample questions. They seem to go into deeper detail than what I have seen in the training classes and deeper than what I see day to day. What would your suggestion be for the best method of gaining the skills needed to effectively manage my SQL environment?

From: William

Hi! Honored that you reached out, hope this email helps. I actually give a presentation on this topic, based on my experience as a writer for the last three generations of SQL certification exams for Microsoft. The exam writers are instructed to test experience by asking questions in the frame of tasks that test whether or not the exam taker has “do this job” before. The exam writers are told to test for someone with 3-5 years of experience at a minimum, by testing things you can’t learn from only reference docs (and especially on brand new features of the latest version of SQL). So that’s who I advise taking the tests: 3-5+ years of xp. 
So my opinion here may be different from others and especially from some managers, but I don’t feel it’s appropriate or productive to ask inexperienced resources to pursue exams. What’s more likely than a passing score is a person becoming disillusioned, frustrated, or disengaged from career progress, or they try to cheat (with brain dumps), or they quit and/or change career path.
 Given that, gauge for yourself whether you think an exam makes sense for you at this stage. Regardless, as for training resources:Again experience is the best teacher here, but I understand the frustration about not being exposed to much variety, as far as SQL development/administration goes. This blog post of mine has links to many resources, I’d point out specifically the “Stairways” and the MVA. If you don’t already have a copy of my book, the Sparkhound office near your area can totally arrange that. Joining your local SQL User Group is good free training, as well as all the virtual user groups that PASS provides for free. Highly recommend joining PASS, it’s free. There’s a SQLSaturday conference in Atlanta next weekend, again more free training, later this year there are SQLSaturdays in Memphis and Baton Rouge and Pensacola, and there are SQLSaturdays that usually happen annually in Birmingham and Columbus, GA/Phenix City, AL (thought I don’t see either in the upcoming events list on right now…)  The wife and I like to make little weekend trips out of those Saturday conferences, and before our kid went off to college, we’d bring them along too for fun.
 As for trying to get hands-on experience, I would give you the same advice I often give my team: “lab it out.” Use your local workstation or laptop, install SQL Server Developer edition, have a local instance to play with at all times. Sign up for an Azure account and use your free credits to run an Azure VM with SQL Developer edition, or if you have an MSDN account through work or otherwise, you get monthly credits for Azure spend. If Azure isn’t an option, use a home PC or server, the hardware doesn’t have to be production-quality to facilitate learning basic concepts and testing admin actions you shouldn’t try on production. I have learned and developed a lot of my toolbox “lab” scripts by just playing and breaking and fixing and dropping and recreating on my SQL sandboxes… all outside of production. So if you don’t have an admin sandbox, get one, just setting it up, breaking and fixing it will be a learning experience.  
I can’t speak personally to any of the paid training classes, other than the SQLSkills folks literally wrote big parts of SQL Server and their training is considered top notch. The PASS Summit conference in Seattle is the biggest/best SQL Server conference with two days of all-day deep dive trainings followed by three long days of sessions, if you have that kind of training money.
 Let me know if you have any questions and best of luck!

Thursday, April 04, 2019

Activate Conference 2019: Databases 101 for the Aspiring App Dev Session Info and Resources

A special hello if you're visiting this blog post during or after my workshop on Thursday afternoon, April 4 at the Louisiana Tech Park as park of the Activate Conference 2019!

Here are all the links, downloads, and more you need:

Databases 101 for the Aspiring App Dev
Workshop Student Track
1:00 PM

Presentation Downloads:

Slide deck: Download link  (.pptx files) 

Sample TSQL 101 script: Download link (.sql file)

Links to get setup with MS SQL Server:

This is the link to download SQL for FREE:
The tools to dev in the Microsoft ecosystem are all free:
Download the WideWorldImporters sample database:
ToolboxGithub (.sql files)
  • Look for for an easy download, or 
  • Click on each file then download, or 
  • Click on each file, click “raw” on each file to copy/paste

Tuesday, April 02, 2019

Activate Conference 2019: Three Days of Tech Learning

Thursday April 4 I'll be giving a workshops at the super-slick-branded Activate Conference 2019 in Baton Rouge at the Louisiana Technology Park, a conference filled with people and topics much cooler than me and my "Databases 101 for the Aspiring App-Dev" 1.5 hour workshop.

Activate is an event that aims to enrich our local tech community by establishing and furthering the careers of individuals in the web and technology field.

3-Day registration for the whole conference, which includes a day of workshops, a hackathon, and a Saturday conference, is free for students. VIP Admission is also available which includes a t-shirt, swag bag and kickoff dinner.

On Saturday, Sparkhound will be hosting a table with our third annual Lego deconstruction competition, with an prize for the fastest times!

See you there, and best of luck to the organizers: Isral, Quinton, Lynsey, and all their many helpers and volunteers!

Tuesday, March 05, 2019

Backup of an Azure SQL DB downloaded outside of Azure

From a dev colleague: “Asking for a client... do you know how to get a backup of an Azure SQL DB downloaded outside of Azure?”

Short answer - You can’t…

Medium answer - … and you don’t really need to for anything related to DR or HA. Backups are automagically handled in Azure, Azure SQL DB georeplication can be set up in a few button clicks. Instead of thinking of Azure SQL DB as a traditional SQL database in a server, think of it as a platform, consider spinning up a stand-alone copy of the production Azure SQL DB in a cheaper tier to set as pre-production. It’d be a better, truer dev/test/qa environment as a result.

Long answers – Okay, so you really want to get the Azure SQL DB to an on-prem SQL Server instance. Sigh.

  1. You can manually script it out into CREATE and INSERT T-SQL statements – schema and data – with various tools, including a compare with SSDT, or an officially supported free crossplatform scripter that is Python-based. Keep in mind this might be a huge file and a lengthy manual process with a large database.
  1. You could also use the “Export” button on the Azure portal for the Azure SQL DB to create a DACPAC on an Azure storage account. The file is locked with a username/password which you specify at the time of export.  It will take a few minutes, even for a small database. Once it's done, you can download the .bacpac file from the blob location with Azure Storage Explorer or something similar, and then import the .bacpac. Keep in mind that this might also be a huge file, and a lengthy manual process with a large database.

Friday, February 01, 2019

"A connection timeout has occurred on a previously established connection to availability replica"

I previously spent some time troubleshooting this issue at one client, and then having encountered it twice more this year, I figured I'd include it in a blog post. Yep, the fix, which is delivered in a CU for SQL 2012, 2014, or 2016 does fix the issue.
Message 35201: A connection timeout has occurred while attempting to establish a connection to availability replica 'replicaname' with id [availability_group_id]. Either a networking or firewall issue exists, or the endpoint address provided for the replica is not the database mirroring endpoint of the host server instance. 
Message 35206: A connection timeout has occurred on a previously established connection to availability replica 'replicaname' with id [availability_group_id]. Either a networking or a firewall issue exists or the availability replica has transitioned to the resolving role.
If you are troubleshooting the above errors, make sure you are on one of these versions (or later)*
  • SQL Server 2016 RTM CU5 or SP1 CU1
  • SQL Server 2014 SP2 CU4
  • SQL Server 2012 SP3 CU7 
*This patch was out before SQL Server 2017 was released, SQL 2017 is not susceptible.

This issue was very problematic because as databases stopped synchronizing, the log files on the primary replica continued to grow. This would eventually create an outage once the volume filled to capacity. Despite all our best efforts, like the KB article says, there's no fix other than rebooting the secondary or removing/recreating the replica. Obviously rebooting/removing the secondary replica doesn't necessarily impact production, but it does impact high availability.

I have encountered this error in multiple environments, once in an Availability Group with 50+ databases, and another also with just 3 databases, one of which had constant high-transactional volume. According to the KB article, "This problem might occur only on very powerful computers and when SQL Server is very busy. For example, in one scenario, this problem occurred on a very busy system with 24 cores."