Quantcast
Channel: CodeSection,代码区,SQL Server(mssql)数据库 技术分享 - CodeSec
Viewing all articles
Browse latest Browse all 3160

T-SQL Tuesday #104 Roundup

$
0
0
T-SQL Tuesday #104 Roundup Bert Wagner Posted on 17 July 2018 Comments
T-SQL Tuesday #104 Roundup
This month’s T-SQL Tuesday topic asked “What code would you hate to live without?” Turns out you like using script and code to automate boring, repetitive, and error-prone tasks.

Thank you to everyone who participated; I was nervous that July holidays and summer vacations would stunt turnout, however we wound up with 42 posts!

Watch tsqltuesday.com for next month’s topic and consider signing up to host .

Watch this T-SQL Tuesday Roundup on YouTube .

Without further ado, here are this month’s entries sorted in random order:

Stuart Moore shares the history behind needing to automate restore testing and writing the SqlAutoRestores PowerShell module to help. Nowadays his commands are found in dbatools. Great example of how a project can evolve through the community. Arthur Daniels shares his script to identify the key and included columns of indexes in a given table. Glenn Berry shares his DMV Diagnostic Queries and the story behind how he started developing them back in 2006. Jason Brimhall links to multiple scripts he’s shared in the past as well as a new script for remotely auditing server access to catch infilitraters red-handed. Doug Purnell talks about how he uses database snapshots and shares some code for how he manages them. Jay Robinson shares two C# extensions (shout to my fellow devs!): one to check an enum for a value and a second to cleanly handle the lengthy DBNull.Value syntax. Drew Furgiuele shares how he scripts out his indexes to re-apply after snapshot replication. He then writes very similar functionality using PowerShell in only 6 lines! Tim Weigel shares which community scripts he uses regularly, as well as sharing his own scripts around replication, stored procedure execution information, and file manipulation. Hugo Kornelis submitted two posts. The first post shares sp_metasearch which helps with performing impact analysis and the second post follows up with an enhancement he’s made to Ola Hallengren’s database maintenance scripts to ignore backup BizTalk databases. Andy Mallon shares his comprehensive script for checking database, file, data, log, etc… sizes. Great explanations of his reasoning for writing the queries the way he did. Dan Clemens shares his database search script with a switch that includes searching across agent jobs. Jess Pomfret wrote a script that shows compression stats for database objects. Wanting to run it against a whole instance (or across mulitple servers), she wrote a dbatoolscommand to automate the process. Kenneth Fisher shows us how he organizes his toolbox using an SSMS solution. Rob Farley shares code he’s written to demonstrate the pain of using NOLOCK. Steve Jones shares a procedure from Microsoft that he uses for transferring logins and passwordsbetween instances. Kevin Hill shares two scripts he uses for finding low-hanging index optimization fruit: one that finds queries performing heap or clustered index scans, and another that returns the top 5 missing indexes per database. Michael Villegas learned that Azure SQL doesn’t allow you to graphically show user roles and permissions, so he wrote a script to query those details (works for on-premise SQL Server as well). Nate Johnson shares scripts that identify if tables are being replicated, whether SSRS subscriptions executed, and how much space certain objects and files are consuming. William Andrus shares how he uses his search script to find similarly named fields or all instances of a piece of text within a database. Bert Wagner (me!) I share my template for generating dynamic table-driven code, making queries more adaptable to future changes. Rudy Rodarte shows us a script he uses for iterating over a date range to use for executing date based queries.

Viewing all articles
Browse latest Browse all 3160

Trending Articles