| A community of more than 1,600,000 database professionals and growing |
| | Disable or Drop When I started working with SQL Server and Windows, it seemed that the administrative side of many actions was limited. We could add and drop many items, but that was it. Relatively few tools allowed setting limits or disabling them, which was a pain. After all, I'd gotten used to setting up accounts for vendors and contractors in Active Directory, often disabling them when they weren't in use. I couldn't do this in SQL Server for many objects, which was a pain and an administrative burden to reset them up when troubleshooting issues. This was pre-PowerShell and .NET when any SMO access was a project in and of itself. These days SQL Server has done a great job of adding in the ability to pause or disable many objects. We've had the ability to lock out an account for many versions, which is a great way to setup a vendor tech support account when it's needed. This is especially important for security these days, as we may want to be sure that we prevent access by any suspect accounts. Disabling them allows us to prevent their use, but keep all their rights and permissions in the even they are valid accounts. We can disable indexes, which can be useful as a precursor to deleting them at some point. We can disable triggers, which is incredibly useful when you are testing or debugging actions on a table. We can disable Extended Events, audits, and more. All of these are useful actions for a developer or administrator, if you use them. When things go wrong, we're often stressed and pressed for time. If there are issues with a system, many of us make snap decisions, which might fix the problem or make the situation worse. Even in those cases where we fix an issue, deleting or dropping objects might cause is extra work later. My question for you is what's your first reaction? When you need to make a quick change to remove something, security access, an index, etc., do you drop or disable? I would hope that you disable, as this removes the effects but keeps the object in the system with associated meta data. Rebuilding permissions or trying to get the old trigger code is a pain (since few people use a VCS, please start doing this). It's possible that you won't even be able to get things reset back up in the same manner. That might be fine, but it's not ideal as new code should be tested, and in a crisis, it likely won't be looked at too closely. At least the previous version of the code was tested in production. Build the habit to disable, not drop, and I think you'll be glad you did. Steve Jones from SQLServerCentral.comJoin the debate, and respond to today's editorial on the forums |
| The Voice of the DBA Podcast Listen to the MP3 Audio ( 3.8MB) podcast or subscribe to the feed at iTunes and Libsyn. The Voice of the DBA podcast features music by Everyday Jones. No relation, but I stumbled on to them and really like the music. | |
|
|
| ADVERTISEMENT | | SQL Clone: Now supporting databases up to 64TB Create copies of production databases and SQL backups in seconds and save up to 99% of disk space using SQL Clone. Redgate’s new tool removes much of the time and resource needed to create and manage database copies, allowing teams to work on local environments to develop, test and diagnose issues faster. Try it free |
| | The industry standard for comparing and deploying SQL Server database schemas Trusted by 71% of Fortune 100 companies, SQL Compare is the fastest way to compare changes, and create and deploy error-free scripts in minutes. Plus you can easily find and fix errors caused by database differences. Download your free trial |
|
|
|
| | | Sergey Benner from SQLServerCentral.com Importing binary files is always a challenge in SQL Server. New Author Sergey Benner brings us a technique using bulk loading that has worked well for him. More » |
| It is a very good idea to get into the habit of qualifying the names of procedures with their schema. It is not only makes your code more resilient and maintainable, but as Microsoft introduces new features that use schemas, such as auditing mechanisms, you code contains no ambiguities that could cause problems. More » |
| This tutorial from Siddharth Mehta is intended to help experienced T-SQL Developers, DBAs, Data Analysts and Data Science enthusiasts to start using Python language with T-SQL. More » |
| MarlonRibunal from SQLServerCentral Blogs My bold learning goals call for adequate preparation and proportionate action. Before plunging into the challenge, I need to get... More » |
| david.fowler 42596 from SQLServerCentral Blogs Part 1 of Creating a SQL Server Test Lab On Your Workstation can be found HERE In the second part of... More » |
|
|
| | Today's Question (by Steve Jones): I want to see just how quickly a backup for my AllTheOrdersEverMade database can run and eliminate the potential latency from storage. Which command should I use? I'm running SQL Server 2016. |
Think you know the answer? Click here, and find out if you are right. We keep track of your score to give you bragging rights against your peers. This question is worth 1 point in this category: Backup and Recovery. We'd love to give you credit for your own question and answer. To submit a QOTD, simply log in to the Contribution Center. |
|
|
| Yesterday's Question of the Day |
| Yesterday's Question (by Steve Jones): I run this code on my SQL Server 2016 instance: CREATE RULE dbo.DBASalaryRange AS @salary > 52000 AND @salary < 99000; Now I want to add this rule to the dbo.Employees table for the salary column. Which code should I use? Answer: EXEC sys.sp_bindrule @rulename = N'dbo.DBASalaryRange' , @objname = N'dbo.Employees.Salary Explanation: Rules are added to alias data types or columns with sp_bindrule. the rule name and the column should be qualified in the statement. NOTE: Rules are deprecated. Check constraints should be used instead. Ref: CREATE RULE - click here » Discuss this question and answer on the forums |
|
|
| Database Pros Who Need Your Help |
| Here's a few of the new posts today on the forums. To see more, visit the forums. SQL server native client version 11.1 vs 11 - We upgrade our server from SQL server 2014 to 2017. I upgraded SSIS 2014 to 2017 by mainly change the connection... Metldown and Spectre - Has anyone deployed any of the patches released for SQL 2016 and SQL 2017 to any of their environments. Is anyone... Divide column data into equal parts - I want to split one of the column's data into 8 equal parts. For eg. i have 73 rows currently... Migrating DBs off of sql 2014 to sql 2016 - All, I will be kicking off a migration project very soon wherein I will setup DB Mirroring in order to do... Deadlock help - Hi, Can you please help me to find what is causing dead lock here and possible fix for it? 2017-12-28 04:18:52.93 spid36s... store data changes(insert\update\delete) - Hi, Ii would like to store the information(EventDate EventDML LoginName DatabaseName TableName HostName IPAddress ProgramName ) in separate table if any data changes(insert\update\delete) happens in any table ... Ola's maintenance solution taking too long on VLDB's - All, I am looking into optimizing Ola's maintenance solution by tweaking around some parameters that is part of the stored proc.... Master database - I've got a server with 175 databases on it, all (theoretically) identical copies of each other from a metadata point... Row inserts for groups of rows (Totals for groups of like data). - I want to group data like all invoices from a supplier which is easy enough but when selecting multiple suppliers,... How to use HAVING with MAX on dates. - Hi, I need to do a report for sales reps showing the customers that haven;t ordered between a set of chosen... Query with Where clause + 3 OR clauses not working - after 40 minutes, none of the three conditions were returned in my results . . . and i had to stop the query... SQL to Excel : Using a SQL Table with Report Columns - This is a SQL to Excel question. We have a new SQL table with report columns and the position that... Audit anyone - I'm wondering if some sort of tutorial exists explaining the basics of database auditing. Our users are complaining data in an... CASE statement slows down query drastically - If i comment out the case statement in this query, it takes less than a second. With the case statement,... How to add more partitions to existed table ? - I have a table that contains records of transactions with ID column is primary key I use partition follow ID column,... SQL Azure - What next - Okay, first I now have Visual Studio 2017 Pro. I want to start looking at SQL Server 2017 capabilities but... New installation, looking for some architecture clarification - I haven't installed SSRS before, but I have installed SQL Server plenty of times (and skipped the SSRS pieces). But... Split data into two tablix - Is it possible to split the tablix data into 2 parts. I have created two tablix -i want to display... 70-473 Anyone studying for this, or passed it? - Hello, I'm studying for this exam, just wondering if anyone else was? Regards, D Potential presentation idea: SQL Server for absolute beginners - So, I took today off from work to prepare and travel to SQL Saturday #517, and something occurred to me... |
|
| This email has been sent to [email protected]. To be removed from this list, please click here. If you have any problems leaving the list, please contact the [email protected]. | This newsletter was sent to you because you signed up at SQLServerCentral.com. Feel free to forward this to any colleagues that you think might be interested. If you have received this email from a colleague, you can register to receive it here. | This transmission is ©2018 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved. Contact: [email protected] |
|
|