| A community of more than 1,600,000 database professionals and growing |
| | Allowing Failure Today we have a guest editorial as Steve is on vacation. I was reading a forum post from Jeff Moden on allowing people to fail. I thought he made some good points and wanted to probe this topic further. For those of you that have children, I think allowing them to fail is one of the hardest things you can experience in life. Often we don’t allow it. We change the situation or the rules so our children don’t experience failure. Yet, we and they can learn things from failure. Good things, that can help us in the future if we let them. It can be similar at work. We have projects, people, systems we have invested our lives in. They are sometimes, kind of like our baby. We don’t want to see them fail. I am not suggesting we should allow major systems to fail or allow data corruption on a production server. Still, sometimes people do make choices that in our opinion are not wise and will not work. In some cases, the best thing to do might be to allow things to take their natural course, which may lead to failure. So why can failure be a good thing? In the case of our children, it gives them a chance to build up their determination and try again. Success can be so much more sweet when you failed the first time around. It is important to learn from our mistakes. To heed advice, and perhaps listen better when someone suggests we are making a bad decision. It can be similar at work. Sometimes you just have to try something before you realize it isn’t a good idea. Nobody likes to be told, “I told you so,” but they might listen to you in the future if you communicate yourself in a positive way. A failure event may be the only thing that changes the direction management is trying to lead you. I believe it is also important to allow ourselves to fail. To take risks with new or old technology, to try new things. It doesn’t mean they need to be released to production, but if we don’t risk failure we can miss out on great gains by not dreaming and reaching for something more. I hope the next time you are in a meeting and you are sure this new idea or plan is doomed to failure, that you pause. That you consider if allowing failure is a good choice in this situation. Perhaps like Jeff’s situation, you will be proven right and you will get new hardware out of the deal. Share a time you allowed someone or something to fail and share how it ended up. Ben Kubicek from SQLServerCentral.comJoin the debate, and respond to today's editorial on the forums |
|
| ADVERTISEMENT | | Watch SQL in the City Streamed 2017 The livestream recording for Redgate's December 2017 virtual event is now available. Technical sessions went into the latest Microsoft SQL Server releases, and covered topical issues such as DevOps, data compliance, protection & privacy. Watch the recording |
| | 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 |
|
|
|
| | | A proper database design is very important, and changes to fix problems after the fact are expensive. In this article, Joe Celko discusses three aspects of database design that are often overlooked: validation, verification, and modification. More » |
| Devin Knight from SQLServerCentral Blogs In this module you will learn how to use the Image Grid Custom Visual. This visual is a unique way... More » |
| Rayis Imayev from SQLServerCentral Blogs (2018-Jan-13) You never know how the weather will behave itself, especially when the temperature gets dramatically changed from +10 to -10... More » |
|
|
| | Today's Question (by Steve Jones): I want to make the $drive parameter of my Get-DbaFreeSpace function mandatory. What declaration should I use? |
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: PowerShell. We'd love to give you credit for your own question and answer. To submit a QOTD, simply log in to the Contribution Center. |
|
|
| |
ADVERTISEMENT | T-SQL Querying (Developer Reference) Squeeze maximum performance and efficiency from every T-SQL query you write or tune. Four leading experts take an in-depth look at T-SQL’s internal architecture and offer advanced practical techniques for optimizing response time and resource usage. Get your copy from Amazon today. | | |
|
|
|
|
|
| Yesterday's Question of the Day |
| Yesterday's Question (by Steve Jones): I have a database with 2 data files. I discover that the performance of this database is very poor as the anti-virus software is freezing access to one of the files. I determine that one file has the name "salesdata.nd". Since ".nd" isn't excluded from AV protection, this is causing me issues. What should I do to rename this file? Assume I can set the database offline/detached if necessary. Answer: Use an ALTER DATABASE command to alter the file name and then rename the physical file Explanation: The easiest way to do this is use the ALTER DATABASE command with MODIFY FILE to change the name of the file in the system metadata. You must also rename the file in the OS. Ref: ALTER DATABASE - click here How to Change the File Extension for a Data File - http://www.sqlservercentral.com/articles/Data+File/164781/ » Discuss this question and answer on the forums |
|
|
| | Sean Smith from SQLServerCentral.com Over the years (and various versions of SQL Server) I have always had a need for different bits of information from the system tables to view activity on a SQL instance. The Microsoft "sp_who / sp_who2" procedures have always provided good information, but never really everything that I needed (and, more importantly, how I needed it... hence the reason for building my own version). It can be run as is (example: EXECUTE dbo.usp_who5) or with optional input filter parameters: @Filter: Limit the result set by passing one or more values listed below (can be combined in any order) A - Active sessions only (includes sleeping SPIDs with open transactions) B - Blocking / blocked sessions only S - Exclude sleeping SPIDs with open transactions X - Exclude system processes @Database_Name: Limit the result set to a specific database (use ---------- for NULL database names) @Exclude_Lock: Suppress lock details from the output (can increases procedure performance on busy servers; defaulted to 1) @Exclude_Log: Suppress log details from the output (can increases procedure performance on busy servers; defaulted to 1) @Exclude_Plan: Suppress execution plan details from the output (can increases procedure performance on busy servers; defaulted to 1) @Exclude_SQL: Suppress SQL statement details from the output (can increases procedure performance on busy servers; defaulted to 0) @Exclude_SQL_XML: Suppress SQL statement XML details from the output (can increases procedure performance on busy servers; defaulted to 1) @Exclude_TXN: Suppress transaction details from the output (also suppresses log details due to an interdependency; can increases procedure performance on busy servers; defaulted to 1) @Login: Limit the result set to a specific Windows user name (if populated, otherwise by SQL Server login name) @SPID: Limit the result set to a specific session When using the procedure you will notice that the query output contains a lot of handy information: SPID: System Process ID Database_Name: Database context of the session Running: Indicates if the session is executing (X), waiting ([]), inactive (blank), inactive with open transactions (•), a background task (--), or not defined (N/A) Blocking: Blocking indicator (includes type of block, SPID list, and deadlock detection when applicable) Status: Status of the session -> request Object_Name: Object being referenced (blank for ad hoc and prepared statements) Command: Command executed Threads: Process thread count SQL_Statement_Batch: Batch statement of the session SQL_Statement_Current: Current statement of the session Isolation_Level: Isolation level of the session Wait_Time: Current wait time (DAYS HH:MM:SS) Wait_Type: Current wait type Last_Wait_Type: Previous wait type Elapsed_Time: Elapsed time since the request began (DAYS HH:MM:SS) CPU_Total: CPU time used since login (DAYS HH:MM:SS) CPU_Current: CPU time used for the current process (DAYS HH:MM:SS) Logical_Reads_Total: Logical reads performed since login Logical_Reads_Current: Logical reads performed by the current process Physical_Reads_Total: Physical reads performed since login Physical_Reads_Current: Physical reads performed by the current process Writes_Total: Writes performed since login Writes_Current: Writes performed by the current process Last_Row_Count: Row count produced by the last statement executed Allocated_Memory_MB: Memory allocated to the query in megabytes Pages_Used: Pages in the procedure cache allocated to the process Transactions: Open transactions for the process Transaction_ID: Transaction ID Transaction_Time: Elapsed time since the transaction began (DAYS HH:MM:SS) Transaction_Type: Type of transaction Transaction_State: State of the transaction Nesting_Level: Nesting level of the statement executing TempDB_Session_Total_MB: Temp DB space used since login for the session in megabytes TempDB_Session_Current_MB: Temp DB space currently used by the session in megabytes TempDB_Task_Total_MB: Temp DB space used by the entire task in megabytes TempDB_Task_Current_MB: Temp DB space currently used by the task in megabytes Log_Database_Count: Databases involved in the transaction Log_Records_All: Log records generated for the transaction (all databases) Log_Reserved_MB_All: Log space reserved for the transaction in megabytes (all databases) Log_Used_MB_All: Log space used for the transaction in megabytes (all databases) Log_Details: Log usage details for the transaction per database (in XML format) Lock_Timeout_Seconds: Lock timeout of the session Lock_Details: Lock details of the session (in XML format) Deadlock_Priority: Deadlock priority of the session SQL_Statement_Batch_XML: Same as "SQL_Statement_Batch" but in XML format SQL_Statement_Current_XML: Same as "SQL_Statement_Current" but in XML format SQL_Handle: Identifier for the executing batch or object Query_Plan: Execution plan of the session (in XML format) Plan_Handle: Identifier for the in-memory plan Since_SPID_Login: Elapsed time since the client logged in (DAYS HH:MM:SS) Since_Last_Batch_Start: Elapsed time since the last request began (DAYS HH:MM:SS) Since_Last_Batch_End: Elapsed time since the last completion of a request (DAYS HH:MM:SS) Command_Pct: Percentage of work completed (applies to a limited set of commands) Command_Completion: Estimated completion time for the command Command_Time_Left: Time left before the command completes (DAYS HH:MM:SS) Host_Name: Name of the client workstation specific to a session Login_ID: Windows user name (or "Login_Name" if user name is unavailable) Login_Name: Full name of the user associated to the "Login_ID" Application_Description: Application accessing SQL Server System_Process: Indicates if the session is a system process SPID: System Process ID If you ever need to remember what the input parameters / output columns are and what they mean, you can simply execute the following: EXECUTE dbo.usp_who5 N'?' Best of all, if there is any blocking and / or deadlocking occurring on the server it will come right to the top of the result set and show you the details immediately. Any friendly feedback is always welcome. Enjoy! More » |
|
|
| Database Pros Who Need Your Help |
| Here's a few of the new posts today on the forums. To see more, visit the forums. Memory pressure and SQL errors - After migration from 2008R2 to 2016, we are plugged with unexplained SQL errors like "cannot continue the execution because the... AlwaysON AG in SQL serer 2012 - Hi All, I'm planning to setup AlwayON AG top of fail-over cluster feature enabled for two node replicas. Can you please suggest... Setting up SSRS Availibilty groups on SQL 2016 Enterprise - Are you able to add reportserverdb and reportservertempdb to an existing always on group or do they have to be... T-SQL Question: Stored Procedure with variables and exec statements - Dear All, I have below stored procedure. IF I execute it passing just one DB name, it works properly : exec uspReturnSPPerformance... OR in JOIN criteria - Apologies if this has been asked before, searching for it yields too many results. I've been eliminating NOT EXISTS in some... Ways to determine what increased the log file. - Hi All, Need some assistance on how i could find which query or process increased the size of transaction log file... SQL SERVER UPGRADE - Hi to you all, i want to upgrade from sql 2008 to 2014 and that will be my first time.My question... Cluster Shutdown Recommendation - We have some electrical work scheduled soon the will involve completely shutting down all power to a data center for... Stored Procedure Dynamic SQL using sp_executesql Not working - I can successfully run a Stored Procedure (SP) that uses dynamic SQL and Exec sp_executesql in my local environment. But... Question regarding Save Transaction and duplicates - Hi, I am getting a duplicate primary key failure message when two SPs called the same SP at the same time.... Coding for Date Range for Specific Weekday- Time (Week To Date) Query - Hello 1. Trying to modify below query to pull data for Week To Date using date from Sunday 3 AM to... Need to convert lowercase characters to 'a' and uppercase to 'A' - Hi, I have a requirement to anonymise the data in table by replacing all the lowercase characters to 'a' and uppercase... Compare previous and next rows to derive output - Hello, Below is the SQL code for sample data. If Object_ID('tempdb..#Case','U') IS NOT NULL Drop Table #Case & Debit Close and Aging - Hi, I want to aging. drop table #TempStk CREATE TABLE #TempStk( IDENTITY(1,1) NOT NULL, NULL, NULL, NULL) &nb Automate LogSHipping for multiple databases - I need to set up log shipping for about 100 databases. Log backup would occur ever 4 hours and would... With Schemabinding - I use With Schemabinding whenever possible, on the theory that it is safer to have things locked up to prevent... Question Regarding Date logic - Hi, I need to get Year, monthname in three letters, startdate and enddate of the month for last two years... DDL Trigger to Track All Database Changes? Permissions - Looking to implement the server level trigger below to track all DDL changes in the instance. How do I get... Spam Spam Bacon and Spam - Wow the spam is just raging out of control again. It seemed to be under control for a few months... Shrink File by using empty file option - Hi All, I have a database which has been archived so half the data is now else where leaving 100gig of... |
|
| This email has been sent to newsletter@newslettercollector.com. To be removed from this list, please click here. If you have any problems leaving the list, please contact the webmaster@sqlservercentral.com. | 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: webmaster@sqlservercentral.com |
|
|