SQLServerCentral - www.sqlservercentral.com

A community of more than 1,600,000 database professionals and growing

Featured Contents

Featured Script

The Voice of the DBA

Better Coding, More Savings

This editorial was originally published on May 13, 2013. It is being re-run as Steve is on holiday.

I'm sure most of us would like to think that we write fairly efficient code. However the reality for many of us might be that we don't actually know. Many of us use the same patterns and practices that we've been using for a long time, rarely changing. When we learn a new technique or find a different way of coding that works better, we tend to then use that method over, and over, and over, and over again.

I would guess that if many of us profiled our code, and examined the CPU and network bandwidth we consume, we might be surprised at what we find. CPU and network usage isn't something we are often concerned about. We assume that we've bought a machine and we should be able to use as much of it as we can at any point in time. That's not the best approach, but since we often have more hardware than we need for many processes, it works. It also explains why so many applications struggle as the load increases. They're not coded efficiently.

If you're going to work in the cloud, you better learn to code more efficiently, mostly because it costs money. If you think about your design, you can reduce the amount of resources you use. In the cloud this translates to less cost. In the on-premises world, this means better performance and higher scale. It also means less complaints and phone calls.

Scaling up an application can be hard, but much of the struggle comes from poorly coding your application in the beginning. Most of us have heard the saying that it takes less time to do it right the first time. That's true in many situations, and it's true for your application development. Learn to write more efficient code and use patterns that conserve resources. You'll find your applications will run better, no matter what type of environment hosts them. If you're not sure what patterns and practices work well, read an article or ask a question and find out what efficient techniques others use.

Steve Jones from SQLServerCentral.com

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

ADVERTISEMENT
SQL Compare

New Redgate SQL Compare 12 has landed!

SQL Compare 12 has landed with a brand new user interface, support for SQL Server 2016, and a wealth of fixes and improvements. Check out this blog post from Redgate's Carly Meichen to hear more about what’s new, why the team have built it, and how. Read now.

SQL Toolbelt

Not enough hours in your day?

The SQL Toolbelt lets you reduce the time spent on SQL Server development and administration. Cambridge University developer David Spaxman, for example, says: “I’m saving 10-12 hours a week using the SQL Toolbelt.” Learn how you can double your productivity, speed up deployments and protect your data. Download a free trial.

SQL Prompt

How can you help your team write better, shareable SQL faster?

Find out by discovering 15 Super SQL Tips from Microsoft MVPs and other SQL Server experts. Using SQL Prompt to write, refactor, and share SQL, they show how it strips away the repetition of coding and standardizes it everywhere. View the tips and download a free trial.

Featured Contents

 

How to Capture Deleted Records

Darko Martinovic from SQLServerCentral.com

This article shows a few techniques that help in capturing deleted records. More »


 

Which Indexes are not Used?

Additional Articles from Database Journal

During the development cycle, indexes will be placed on SQL Server tables to speed up performance when searching for records. Lots of thought probably has gone into creating just the right mix of indexes based on how developers think customers will use the system. But how do you tell if all the indexes are being used once your database has been implemented into production? More »


 

Managing multiple database versions

Additional Articles from Redgate

Sometimes, it's necessary to have different versions of a database running in production. But how do you establish a single source of truth in source control? Alex Yates from DLM Consultants shows how to use object filters in SQL Compare to build multiple database versions from the same source. More »


 

From the SQLServerCentral Blogs - Database Clone

Grant Fritchey from SQLServerCentral Blogs

There are a bunch of ways you could create a database clone. Backup and restore is one method. Export/Import is... More »

Question of the Day

Today's Question (by Steve Jones):

What are the possible backup priorities for my Availability Group?

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: High Availability (HA).

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

Professional Microsoft SQL Server 2016 Reporting Services and Mobile Reports

Professional Microsoft SQL Server 2016 Reporting Services and Mobile Dashboards provides a comprehensive lesson in business intelligence (BI), operational reporting and Reporting Services architecture using a clear, concise tutorial approach. You'll learn effective report solution design based upon many years of experience with successful report solutions. Improve your own reports with advanced, best-practice design, usability, query design, and filtering. Get your copy from Amazon today.

Yesterday's Question of the Day

Yesterday's Question (by Steve Jones):

In SQL Server 2016 SP1+ Standard Edition, how many databases can be put in an Availability Group?

Answer: 1

Explanation:

In Standard edition of SQL Server 2016, no matter the service pack, only Basic Availability Groups are supported, which allow for a single database in the AG.

Ref: Basic Availability Groups - https://msdn.microsoft.com/en-us/library/mt614935.aspx


» Discuss this question and answer on the forums

Featured Script

Query Performance comparison between instances

Rodrigo Acosta from SQLServerCentral.com

Compares performance of queries between different SQL Server instances.
1) Execute at source, and will generate an output with TSQL commands to create temp tables filled with top 50 long lasting queries from all databases.
2) Then execute output at destination and will do the same and show comparison of matching queries!!
The query only creates temp tables and perform selects on dm_exec_query_stats, you can execute it without issues.
It will show comparision of query plans that hash to the same value.

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.

SQL Server 2014 : Administration - SQL Server 2014

How to modify query to only use base tables - I'm new to SQL so I'm not really sure what to do. Also not sure if I'm on the right forum...

CDC - Hi Guys, Understand that subscriber/publisher is deprecated. There is a product from MS -Change Data Capture for Oracle by Attunity that does...

Table copy - hI all, how can i copy a table with an specific amount a data. example: myTable has 5 millions rows. I will create myNewTable...

moving sql2005 database to sql2014 - Hi, Can we directly restore sql2005 database backup on sql2014 instance ? thanks.

Stored Procedure help - I wrongly posted this in SQL Server 2005 so re-posting here as I couldn't move it. I'm running SQL Server...


SQL Server 2014 : Development - SQL Server 2014

Desing of a table and Hirerarchy - IP's - want to build a table, which contains different ip and there sub-net. when i pull the table i want to get...

GROUP BY in SQL Server 2014 - Hello all, The same query with a group by clause I try to run on SQL Server 2005 and on SQl...


SQL Server 2012 : SQL Server 2012 - T-SQL

RAISERROR - Stored Proc wrapped in sqlAgent job - hi, This is a classic scenario of an SP wrapped in a sqlAgent job and despite SP failing to do its...

looking for a query to split string and save each portion to variables - I have a db with a field like 'US01/00000/12345/123456', I need to split it into 4 parts and save each...

Random number generation based on condition - [img]http://www.sqlservercentral.com/Forums/Attachment19709.aspx[/img] Need to generate random number based on ID3 column. Have mentioned each rows logic in remarks. Note: This is a...

Parsing paired relationships. - Hmmm... OK, I can do this but only with some really expensive RBAR table operations, the script I've written takes...

Update had to be done in two steps, Why? - Originally I had this query: Original value for starttime is 1800001 (Clarion time figures based upon 1/100 of a sec since...


SQL Server vNext : SQL Server 14 - Administration

fgrfdhb hrfn vbn df - [url=http://www.inqaahe.org/sites/default/files/webform/Rogue-One-2016-Online-tv-guide-12-18-sunday-theatre-show.pdf]Rogue One 2016 Online[/url] [url=https://www.aertery.com/sites/default/files/webform/to-night-hopkins-v-s-smith-live-stream-boxing-round-by-round-hd-coverage.pdf]Hopkins vs Smith Live Stream[/url] [url=https://www.aertery.com/sites/default/files/webform/fox-tv-dolphins-vs-jets


SQL Server 2008 : SQL Server 2008 - General

Rogue One‘s ‘A’ beats the A-s earned by all the George Lucas prequels - [url=http://www.inqaahe.org/sites/default/files/webform/Rogue-One-2016-Online-tv-guide-12-18-sunday-theatre-show.pdf]Rogue One 2016 Online[/url] [url=https://www.aertery.com/sites/default/files/webform/to-night-hopkins-v-s-smith-live-stream-boxing-round-by-round-hd-coverage.pdf]Hopkins vs Smith Live Stream[/url] [url=https://www.aertery.com/sites/default/files/webform/fox-tv-dolphins-vs-jets


Reporting Services : SSRS 2012

Matrix Help needed - [img]http://oi67.tinypic.com/202t06.jpg[/img] I have to display Subtotals for each category using Matrix table just like this without modifying anything in Custom Code...


Programming : General

wasn’t even a full-time boxer. Instead, - [url=http://www.inqaahe.org/sites/default/files/webform/UFC-22-live-Fight-VanZant-vs-Waterson-live-stream-Fox-online-HD.pdf]VanZant vs Waterson Live Stream[/url] [url=http://www.inqaahe.org/sites/default/files/webform/ESPN-Tv-Hopkins-vs-Smith-Live-Stream-Full-HBO-Fight-Online-WebCastDec-17-2016.pdf]Hopkins vs Smith Live Stream[/url]

in June, but before this fight, he - [url=http://www.inqaahe.org/sites/default/files/webform/Rogue-One-2016-Online-tv-guide-12-18-sunday-theatre-show.pdf]Rogue One 2016 Online[/url] [url=https://www.aertery.com/sites/default/files/webform/to-night-hopkins-v-s-smith-live-stream-boxing-round-by-round-hd-coverage.pdf]Hopkins vs Smith Live Stream[/url] [url=https://www.aertery.com/sites/default/files/webform/fox-tv-dolphins-vs-jets

New-York-Jets-vs- Miami-Dolphins -New-Yo -Jets-vs- Miami-Dolphins - [url=http://www.inqaahe.org/sites/default/files/webform/ESPNMiami-Dolphins-vs-New-York-Jets-Live-Stream-NFL-Football-OnlineWebCast-Dec-17-2016_2.pdf]Dolphins vs Jets Game Live[/url] [url=http://www.inqaahe.org/sites/default/files/webform/livemiami_dolphins_vs_new_york_jets_live_streaming_0.pdf]Dolphins vs Jets Game Live[/url] [url=http://www.bmj.com/sites/default/files/zNew-York-Jets-vs-Miam


Programming : XML

Help with XML Splitter De-entitization, please. - I'm writing an article on performance testing and one of the functions I'm testing is an XML CSV splitter. Here's...


Data Warehousing : Strategies and Ideas

Creating a small banking datawarehouse - Hi all, Let me first introduce myself. I'm new to the site. My reason to join is that I have just...

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 ©2015 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved.
Contact: webmaster@sqlservercentral.com