Problems displaying this newsletter? View online.
SQL Server Central
Featured Contents
Question of the Day
The Voice of the DBA
 

Daily Coping Tip

Focus your attention on the good things you take for granted

I also have a thread at SQLServerCentral dealing with coping mechanisms and resources. Feel free to participate.

For many of you out there working in a new way, I'm including a thought of the day on how to cope in this challenging time from The Action for Happiness Coping Calendar. My items will be on my blog, feel free to share yours.

Start Fixing Your DB with Better Code

This editorial was originally published on November 16, 2017. It is being re-published as Steve is on vacation.

I ran across an interesting article from Gitlab. They host git repositories for companies that develop software, and of course, part of their hosting is tracked in a database. They use PostgreSQL for their data, and were not happy with the performance of their database backing the system. Up front they admit part of the issue is their own coding, which is likely the problem in so many software projects.

Gitlab accepted this, and certainly many database developers or consultants will let management know that the problem causing poor performance is often poorly written code. Jeff Moden constantly explains in his articles how better code can dramatically reduce the load on your SQL Server, yet fixing code is often the one thing few organizations want to focus on. It's easier to buy more hardware, which often just hides the problem for am all-too-short period of time. Or just complain and try to write new features that take the place of old ones.

I'm sure many of you have heard your parents or teachers tell you it takes about as long to do something right as wrong, so do it right the first time. Often taking a shortcut doesn't really save time. I'm not sure that's true with development. Often it's quicker to do it wrong because doing it right takes a little more planning, and perhaps some testing, likely a bit more time to carefully construct code, and certainly more time to learn how to write code better. That last item is the issue, as so many of us learn to write code poorly, without examples that give us good habits from the start.

The best developers have spent lots of time writing code poorly and learning how to improve their work. They know the tips and tricks in their language(s) of choice. That might be better SQL to create efficient queries, better C# to avoid constantly hitting the database, or something else. However, as most of us learn to write code, we don't learn the best way. We learn the ways that are easiest to teach a user concepts, most of which don't scale well.

If you've made the investment to learn about writing better code, then it doesn't take any longer to write good code from the start. If you've made the investment, and if you practice what you've learned. Jeff has lots of great articles on writing better code, as do many of our other authors. Take a few minutes today and learn to build better SQL code. Your database (and users) will thank you.

Steve Jones - SSC Editor

Join the debate, and respond to today's editorial on the forums

 
 Featured Contents
SQLServerCentral Article

Understanding Azure Data Factory Pricing

arindamxs from SQLServerCentral

Learn how Azure Data Factory charges you for use and how to estimate what your charges would be based on a few examples.

External Article

Working with MySQL Views

Additional Articles from SimpleTalk

Views in MySQL allow you to save a predefined SQL query. Robert Sheldon explains the benefits of views and how to create and query them.

External Article

Why you need to go beyond dynamic data masking

Additional Articles from Redgate

Data masking is defined as replacing sensitive data with a realistic fictional equivalent. But do you know there are 2 key types of Data masking, and what each offer? Join SQLServerCentral Editor, Steve Jones, in this 30-minute webinar to find out more.

Blog Post

From the SQL Server Central Blogs - Self-hosted integration runtime

Joyful Craftsmen from Joyful Craftsmen Blog

V rámci svojho bootcampu (https://joyfulcraftsmen.com/bootcamp/) v Joyful Craftsmen, na ceste stať sa Data Engineerom, som sa často (rozumej takmer vždy) stretol s novými technológiami. Keďže jednou z bežných činnosti...

Blog Post

From the SQL Server Central Blogs - Scripting with a temp stored procedure

Kenneth.Fisher from SQLStudies

A few years back I learned about temporary stored procedures from a Kendra Little (blog|twitter) blog post. At the time ... Continue reading

 

 Question of the Day

Today's question (by Steve Jones - SSC Editor):

 

Minimal Configuration

If I start a SQL Server instance with the -f parameter, it starts in minimal configuration. Which of these things apply?

Think you know the answer? Click here, and find out if you are right.

 

 

 Yesterday's Question of the Day (by Steve Jones - SSC Editor)

Funny Quotes

What movie contains this quote?

"On the other side of the screen, it all looks so easy. "

Answer: Tron

Explanation: This is from the movie Tron. Ref: Movie quotes - https://www.quotes.net/mquote/99157 Happy April Fools Day!

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 2017 - Development
Remove some text - I would like to remove rtf from my Note column. I tried this: SELECT Note, LTRIM(Note, 'rtf') from [PatientNote]. I get an error. Please advise? I also tried the Replace function, but no text are altered/deleted.
OPENJSON - unnamed nested array - Currently working on sql script to extract from JSON file(s) but i've come across an unnamed array within a named array Wondering if anybody had any idea how to extract this? rest of my script is working fine using CROSS APPLY OPENJSON to extract what i require and where the arrays are named i'm having […]
Trigger: Need help to save activity log on delete - Hi, My table design as following, CREATE TABLE [dbo].[SFAProject]( [Id] [int] IDENTITY(1,1) NOT NULL, [TenderName] [varchar](200) NULL, [ClientsId] [int] NOT NULL, [SalesPersonId] [nvarchar](450) NULL, [SFAStageId] [int] NOT NULL, [SFATenderCategoryId] [int] NOT NULL, [SubmitDate] [date] NOT NULL, [TenderValue] [decimal](18, 2) NULL, [TenderCost] [decimal](18, 2) NULL, [TenderRemark] [varchar](500) NULL, [CrtBy] [nvarchar](450) NULL, [CrtDte] [datetime] NULL, [UpdBy] [nvarchar](450) […]
SQL Server 2016 - Administration
Slow SQL Server Performance PAGEIOLATCH_SH, CXPACKET help! - Hi All, (see attached waits) I have a very slow sql server, it seemed to happen over night and queries are still slow. index rebuild/reorg and statistics have been updated. what are my troubleshooting options?  
AG changed to Distributed state - Hi, AG Listener does not get connected application due to Availability Group name (primary) changed to Distributed state automatically and second node Availability Group name resolving state, also both the nodes databases not synchronized.  Please suggest what could be reason and why automatically AG state changed? Availability Group name - existing setting was Manual failover […]
SQL Server 2016 - Development and T-SQL
SQL Server Jobs - Retry Attempts - I know in SQL Server jobs, if a step fails, you can set the number of retries and interval.  What I want to do though is if a step fails, retry the entire job from Step 1, not just the individual step. The reason I need to do it this way, is that the first […]
Order of processing of windows function - Hi Experts, Please can you let me know the order of processing of the window functions, The second in order DENSE_RANK is executed first before the first one, is this right ? when I add group by to the below commands, there is no change whatsoever. May I know why group by has no impact […]
SQL 2012 - General
Scalability in SQL and NoSQL? - Hello All, I am working on a web application project and I want to know which database design is right from a scalability point of view between SQL and NoSQL. According to this source, SQL is vertically scalable (Add resources to increase the capacity of the existing hardware and software) and I have no idea […]
SQL Server 2019 - Development
Refactoring an Entity Attribute Value schema - Apologies in advance, as I know this has been discussed a million times already but I think our requirement is slightly different from the norm in that we have a well-defined, static set of attributes up front and our values are rows in a table. But feel free to ignore if you've had enough of […]
Amazon AWS and other cloud vendors
AWS S3 Questions - Hi all, Just starting out with AWS and had a few questions.. What are requests? And what constitutes a request? How can I figure out how many requests my backup product (Veeam, Rapid Recovery) will be making? Our backup products do not support directly backing up to glacier, and I'd like to save costs as […]
General Cloud Computing Questions
Few questions about cloud computing course - Hi I'm currently doing a networks management degree level 7. I'm in the final year of the level 7 and I'm the only one in the course who wants to go onto the level 8 add on cloud computing and infrastructure. 1: would the college still do the course if I was the only one […]
Azure Data Factory
ODBC Source into Data Flow Activity - I would like to work with an ODBC source in Azure Data Flow. However I understand that ODBC is currently not a supported Data Source. It was recommended on the Microsoft website that I move the data into into a supported data source and then use that in the Data Flow. Does anyone know of […]
Reporting Services
Dynamic Drop Down in SSRS - In SSRS reporting, is it possible to dynamically drive drop down values based on a main table and sub table?  (e.g. Category and SubCategory). For example, I have the following two tables: -- DROP TABLE #c CREATE TABLE #c (CategoryID int, CategoryDesc varchar(100)) INSERT INTO #c VALUES (1, 'Fruit') INSERT INTO #c VALUES (2, 'Veggie') […]
Create 1 calendar for each student - Hello! I'm attempting to replace a clunky mail merge process with SSRS 2016. The data is the attendance code for a list of students on each school day of a month. (picture Columns: Student_id,  School_Date, Attendance_Code for a given month) I need to depict their attendance on a calendar, simply placing the contents of Attendance_Code  […]
Integration Services
Split column on Data Types - Please assist? I would like to split column Event in two columns based on data types.
 

 

RSS FeedTwitter

This email has been sent to {email}. 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.
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved.
webmaster@sqlservercentral.com

 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -