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

IoT Increases Efficiency

There is no shortage of articles about problems with IoT, especially with consumer based IoT products. In fact, many of the ideas and sales are gimmicky with dubious value for me, but I know what some people get excited that they can change their home thermostat from the car or have the fridge send them an inventory, or even have a tracker on their keys.

There certainly are some great implementation, especially in healthcare, but I think there is a lot of IoT that can really help in business, some of which will create new opportunity for us as data professionals. As the costs for sensors come down and their capabilities rise, I'm sure more people will come up with interesting ways that they can be used.

I spent quite a few years earlier in life working in the restaurant industry, and I've spent my whole life shopping in grocery stores for ingredients to cook with. I know margins are low in these businesses, and there is a lot of waste. When I ran across this article on using IoT in the food industry, I was skeptical that it would become commonplace, but I think I might be wrong. Keeping food fresh has a noticeable impact on profits and sales, and cheap sensors that can help measure data is important in all stages. From the supply chain to your fridge, if data can inform you of those foods that are nearing the end of their lifetime, perhaps you'd make different decisions in shipping, in promotions in restaurants, or even in the recipes you pick for tonight.

And I'm sure there are some of you that would love to chat about the source and age of the lettuce in your salad at a restaurant. That's not for me, but IoT is going to change our lives in many ways and give us lots of data with which to work.

Steve Jones from SQLServerCentral.com

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


The Voice of the DBA Podcast

Listen to the MP3 Audio ( 3.0MB) podcast or subscribe to the feed at iTunes and Libsyn. feed

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 Monitor

Don’t just fix SQL Server problems, prevent them from happening

SQL Monitor helps teams looking after SQL Server be more proactive. Not only does SQL Monitor alert you to current issues, it gives you the information you need to stop them happening in the future. Download SQL Monitor now and get a 14 day free trial

SQL Prompt

Become a more efficient SQL developer with SQL Prompt

Learn how to write SQL faster and more efficiently with these exclusive short videos from Data Platform MVPs and SQL Server experts. With SQL Prompt you can strip out the repetition of coding and write SQL 50% faster. Check out the tips

Featured Contents

 

Sending table form HTML emails from a SQL Server database engine

Evgeny Garaev from SQLServerCentral.com

The solution which helps to smiplify delivery of a table content in the HTML form using Database mail More »


 

SQL Server Machine Learning Services – Part 3: Plotting Data with Python

Additional Articles from SimpleTalk

One of the advantages of running Python from SQL Server is the ability to create graphics to assist in analysis of data. Robert Sheldon demonstrates matplotlib, a 2D plotting library, widely used with Python to create quality charts. More »


 

The top 7 business benefits of establishing DevOps in your organization

Any change within an organization requires an investment of time, expertise and money. Therefore, it is natural that leaders should assess the potential of DevOps in terms of what it will deliver: Managers should ask the question: What is to be gained by changing our current way of doing things? More »


 

From the SQLServerCentral Blogs - SQL Server on Linux Series: Expanding LVM Drives

kleegeek from SQLServerCentral Blogs

Next in our SQL Server on Linux series is one important question. On Windows, if you’re about to run out... More »


 

From the SQLServerCentral Blogs - What’s dbo?

Kenneth Fisher from SQLServerCentral Blogs

Don’t you hate it how certain words (well, acronyms in this case) get reused to mean multiple things? dbo seems... More »

Question of the Day

Today's Question (by Evgeny Garaev):

Which data type should be used to store a JSON data in a SQL Server 2016 database?

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: JSON.

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

Pro Power BI Desktop

This book shows how to deliver eye-catching Business Intelligence with Microsoft Power BI Desktop. You can now take data from virtually any source and use it to produce stunning dashboards and compelling reports that will seize your audience’s attention. Slice and dice the data with remarkable ease then add metrics and KPIs to project the insights that create your competitive advantage.

Yesterday's Question of the Day

Yesterday's Question (by Steve Jones):

I've got this table and data:

 CREATE TABLE TheCounts ( intcol INT , charcol CHAR(10) , varcharcol VARCHAR(100) , datecol datetime2 ) GO INSERT TheCounts VALUES (1, 'West', 'Denver Broncos', '2018-01-01') , (2, 'West', 'Oakland Raiders', '2018-01-01') , (3, 'West', 'Los Angeles Chargers', '2018-01-01') , (4, 'West', 'Kansas City Chiefs', '2018-01-01') , (5, 'South', 'Jacksonville Jaguars', NULL) , (5, 'South', NULL, '2018-01-02') , (6, NULL, 'Indianapolis Colts', NULL) , (7, NULL, 'Houston Texans', NULL) , (NULL, 'North', 'Pittsburgh Steelers', NULL) , (NULL, 'North', 'Baltimore Ravens', '2018-01-03') , (NULL, 'North', 'Cincinnati Bengals', NULL) , (NULL, 'North', 'Cleveland Browns', NULL) , (13, 'East', 'Cleveland Browns', '2018-01-04') , (13, 'East', 'Cleveland Browns', '2018-01-04') , (14, 'East', 'Cleveland Browns', '2018-01-04') , (14, NULL, 'Cleveland Browns', NULL) 

What do I get when running this code?

 SELECT COUNT(DISTINCT 'North') FROM dbo.TheCounts AS tc 

Answer: 1

Explanation:

The scalar value has no real meaning here with the table. The DISTINCT count of the scalar value is 1.

Ref: COUNT() - click here

The COUNT Functionin T-SQL - http://www.sqlservercentral.com/articles/T-SQL/142568/


» Discuss this question and answer on the forums

Featured Script

Run SQL/T-SQL scripts on folder

Daniel Marques from SQLServerCentral.com

A bat script to run all the sql/t-sql scripts in a specific folder.

Features:


- Using SQLCMD for running the scripts.

- Logging the results of your sql to a file per script.

- Input for scripts and log folders.

- Beginning and end times for each script.

- Check if the folders are exist

- Total running duration of each script saved in the logs.


Usage:

- Create a empty .bat or .cmd and copy and paste the code in it.

- Change your machine and instance name(for clusters) for single instance you just need your machine name.

- Put your credentials(if needed)

- Run the script, you will be prompt with the scripts and logs paths(can be the same).

- Just wait...the bat will do the rest :)

There are other scripts out there that can do this, this just one more, simple and working.

Use and abuse.

Daniel Marques

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 : Development - SQL Server 2014

The conversion of the varchar value overflowed an int column - the below script is return this error : The conversion of the varchar value '4103049600' overflowed an int column declare @jsondate varchar(40)...


SQL Server 2012 : SQL 2012 - General

Cannot create primary key Serial to table have existing data . - Problem Cannot create primary key Serial to table have existing data . Table structure USE GO/****** Object: Table .  Script Date: 2018/01/27...


SQL Server 2008 : SQL Server 2008 - General

How to find who has installed SQL Server Instance in SQL Server 2008, 2008 R2 and in 2012 - Hi - How to find who has installed SQL Server Instance in SQL Server 2008, 2008 R2 and in 2012? In SQL...

Adding Existing Jobs as Subplans to Maintenance Plan - I have a couple of jobs I'd like to consolidate into one maintenance plan. When I create a new maintenance...


SQL Server 2008 : SQL Server Newbies

I need to speed up the insertion of row into a table - I am in need of some tutoring and advisement.  I am a nubee when it comes to designing processes as...

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