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

Daily Coping Tip

Listen to a piece of music without doing anything else

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.

I Hate To Send This Email

This editorial was originally published on 23 Mar 2017. It is being re-run today as Steve is on holiday.

I use TrueDelta to report my car status every month. It's a nice service, allowing car owners to see what experiences others have, and think about which models and years might be a good fit for me. I've tracked multiple cars with their service for the last 3-4 years, with reminders from them every quarter to update any repairs I've made.

Recently I got an email from them with this opening: " We hoped never to have to send this email. A few days ago we learned that TrueDelta has joined the increasingly long list of organizations whose server security has been breached by hackers." The email went on to note that names and passwords to taken, and that everyone needed to perform a password reset. I applaud them for including "Security breached" in the subject as well as immediately changing everyone's passwords so old ones wouldn't work.

I've been hacked at SQLServerCentral, though to our knowledge no data was stolen, merely vandalized. We haven't ever been able to track suspected data breaches back to SSC, and I hope we never do, but I'm not naive to think that we never will. I hope we don't, but hackers make determined efforts to gain access to data. At least we are aware of security measures, have a small staff with administrative access, and try to not allow any simple attack vectors.

Not every company does a great job at securing their data, especially from phishing attacks. There's a spectrum of how carefully data is protected by organizations, and as we've seen from haveibeenpwned.com and plenty of media reports, more and more companies lose data all the time. Some of those companies notify customers (some have to), and I would guess more than a few people have had to send out emails they never expected to send. More of us will dsend those emails in the future, and we should think about that today. Is there something we can do to avoid having to send those notifications?

There probably isn't something to ensure it never happens, but we can certainly work towards improving our security. As developers, we shouldn't have short limits or character choices for passwords. If you wonder why, there's a great answer at security.stackexchange. We shouldn't be writing our own authentication schemes, but incorporating code that's been written, vetted, and reviewed. And make sure we apply patches. Most of the security holes in software are known and patched, but without being deployed. Certainly if new patches become available, we should be able to incorporate them quickly. Above all, learn what SQL Injection is and don't allow unvetted user input in queries, including those in hidden form fields.

Steve Jones - SSC Editor

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

 
 Featured Contents

Solving FIFO Queues Using Windowed Functions

drew.allen from SQLServerCentral.com

One common request often seen in T-SQL is working with queues of information. In this piece, J. Drew Allen will show to use windowing functions and the OVER clause to process a FIFO queue.

Automating Migrations for Multiple Databases using Flyway

Additional Articles from Redgate

During development you need a fast, automated way to build multiple copies of a database on any development or test server, with each database at the right version. This article provides a PowerShell automation script for Flyway that will do the job.

Exploring Four Simple Time Series Forecasting Methods with R Examples

Additional Articles from MSSQLTips.com

In this article we explore four simple time series forecasting methods using R: the Mean Method, the Naive Method, the Seasonal Naive method and the Simple Moving Average Method.

From the SQL Server Central Blogs - The SQL Saturday Foundation Vision

Steve Jones - SSC Editor from The Voice of the DBA

A few things to start. First, this is about SQL Saturday events. Only. This is NOT about the future of the Summit. Redgate is working on that separately from...

From the SQL Server Central Blogs - Moving Into Consulting 101 - Part 3 - The Hours of a Consultant

Will Assaf from SQL Tact

This is part three in a five part series this week, Moving into Consulting 101.  

Today's topics talk about why you were hired. How is your work likely to be quantified,...

 

 Question of the Day

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

 

Where is the job id?

I want to stop an asynchronous statistics update job with the KILL STATS JOB command. This needs a @jobid parameter. Where do I find that information?

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)

Fun Quotes

What movie is this quote from: "You have been recruited by the Star League to defend the frontier against Xur and the Ko-Dan armada. "?

Answer: The Last Starfighter

Explanation: A fun, sci-fi , game movie from the 80s. Happy April Fools Day. Ref: Starfighter quotes - https://www.rottentomatoes.com/m/the_last_starfighter/quotes/

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
Simple GROUP BY Query - Hello: I have this query.  I am trying to understand why I have to GROUP by all of the fields in my SELECT Statement.  Also, the query is returning the sum for all of the jmoJobID fields, when I want this to be summed by the jmaPartID field. SELECT DISTINCT JobOperations.jmoJobID, JobAssemblies.jmaPartID, JobOperations.jmoWorkCenterID, JobOperations.jmoProcessID, JobOperations.jmoOperationQuantity, […]
SQL Server 2016 - Administration
AG Question - is it possible to make secondary database to read/write in secondary replica in always on .
Development - SQL Server 2014
Count Null Records with Group BY - I've searched and tried many variations, but must be missing something simple. If there are no records, I'm trying to get RecordCount to display zero '0'. I don't get errors, just no results. What am I missing?   Thanks! SELECT IsNull(Count(InvNo),0) AS RecordCount, BatchID FROM BatchOrders GROUP BY BatchID
group parts by row count - hello I have a table similar to this: Create table parts ( partid int not null serial varchar(50) not null )   insert into parts(partid, serial) values(1,'31511') values(1,'961511') values(1,'61511') values(1,'77421') values(1,'74522') values(1,'329484') values(1,'1934891') values(1,'19348924')   so what they want is to have it grouped by for ever 5, give it a group ID, and have […]
SQL 2012 - General
Query Issues - pageiolatch_sh wait high clustered index insert cost - Hi Accidental DBA here We have an application that runs a select * on a table upon starting the application. There are 2.4 million rows in the table. Today it was reporting a pageiolatch_sh wait and took 50 minutes to complete. During this time the application cannot be used until the query completes. Looking at […]
Change Owner on AG Endpoints - A long-serving DBA is leaving us soon, and his account is the owner of various bits and pieces within one of our AGs. Not ideal, but one of those things from when the company originally set the system up, many years ago,  and has never been addressed. We're quite happy with the code that we […]
SQL Server 2019 - Administration
There and back again: From a partition number to a filegroup and vice versa -   I've been trying to navigate the DMVs concerning partitions and filegroups and find my way between them. I might have a partition number and want the filegroup name(s) (and ultimately the files in the group). Or, I might have a filegroup or filename and want the partition(s) that it holds. Here's my test case: USE master; DROP DATABASE IF EXISTS TestParts; CREATE DATABASE TestParts ALTER DATABASE TestParts ADD FILEGROUP FG1 ALTER DATABASE TestParts ADD FILEGROUP FG2 ALTER DATABASE TestParts ADD FILEGROUP FG3 ALTER DATABASE TestParts ADD FILE (NAME=File1, FILENAME = 'C:\temp\File1.ndf', SIZE = 1MB) TO FILEGROUP FG1 ALTER DATABASE TestParts ADD FILE (NAME=File2, FILENAME = 'C:\temp\File2.ndf', SIZE = 1MB) TO FILEGROUP FG2 ALTER DATABASE TestParts ADD FILE (NAME=File3, FILENAME = 'C:\temp\File3.ndf', SIZE = 1MB) TO FILEGROUP FG3 Now, create a partitioned table: USE TestParts […]
SQL Server DWH on local Storage Spaces - Hi there, I am setting up a SQL Server 2019 EE with WS2019 with local storages spaces. I have tried out different layouts for the storage e.g. Storage Spaces - Virtual Disk with 2way mirror, Storage Spaces - Virtual Disk with 3way mirror. with my DWH tests on my specific hardware the version Storage Spaces […]
Patching SQL Servers - Hi all. Just curious about SQL patching and SQL updates. Who does the patching in your environment? Networking teams or DBAs? What are the pros and cons of either.  Thanks! Anita
SQL Server 2019 - Development
Loan Amortization Schedule for SQL Server - So, long story short... A conversation about loops, cursors and in-line functions ended up with me proclaiming that I could could do a full payment level, loan amortization schedule using only set based t-sql (famous last words). My attempt to cheat by finding something pre-rolled on Google fell flat and was forced to actually do […]
Subquery returned more than 1 value. This is not permitted ! - Hello, I run the following query: SELECT RIS_OPT_SERV.CTC_DEPOT ,CONVERT(CHAR(4), B.DATE_DEPOT, 120) + '-' + CONVERT(CHAR(2), B.DATE_DEPOT, 101) DATE_DEPOT ,RIS_OPT_SERV.NO_CONTRAT_DEPOSANT ,RIS_OPT_SERV.NOM_DEPOSANT ,RIS_OPT_SERV.NO_CLIENT_DEPOSANT ,RIS_OPT_SERV.NUMERO_REF ,RIS_OPT_SERV.LB_PRODUIT_LONG ,RIS_OPT_SERV.LIB_OPTION_AFF ,RIS_OPT_SERV.NO_BORDEREAU ,RIS_OPT_SERV.LIB_SERVICE ,B.PRODUIT ,B.MECA ,B.PRESENTATION ,B.TRANCHE ,B.NB_PLIS ,B.POIDS ,B.TARIF FROM (SELECT RIS.NO_CONTRAT_DEPOSANT ,RIS.NOM_DEPOSANT ,RIS.NO_CLIENT_DEPOSANT ,RIS.CTC_DEPOT ,RIS.NUMERO_REF ,RIS.NO_BORDEREAU ,RP.LB_PRODUIT_LONG ,(SELECT RS.LIB_SERVICE FROM RESSOURCE_SERVICE RS WHERE RS.CLE_REF = RIS.CLE_REF AND RS.CODE_SERVICE in (SELECT […]
Question on BCP - I have been looking everywhere, and cannot find anything on this . Can anyone tele me if you can used BCP and xp_cmdshell to insert data from one table to another? and if this can be done please let me know where I can get information on this. Thank you
SQL Server 2008 Performance Tuning
Same queries different client with different performance - I have 20 same client programs each installed in windows xp. Each client issues a specific query to sql server 2008 R2 in a database with compatibility level 80 (Sql Server 2000). The clients use ODBC. The performance suddenly dropped too much. except for one machine. and now I'm wondering why. I attach 2 trace […]
Same queries different client - I have a Siebel CRM with Sql Server back-end database (Sql server 2008 R2 but the database has compatibility Level 80 (Windows 2000)). Each Siebel client is Windows XP with a front-end installation. The client pc has access to the back-end database through ODBC (Sql Server 2000). All of the clients suddenly slow down a […]
Reporting Services 2005 Administration
How can we let SQL Server 2005 X86 recognize and use RAM greater than 4GB - I have a windwos server 2003 R2(64bit) installed SQL Server 2005 X86 Standard Edition . I have enabled AWE(as screenshot), and restarted windows server, but when I ran SQL Server (even if I ran the complicated computation). system can't use the RAM greater than 4GB.  because as some reason we can't upgrade SQL server from […]
 

 

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

 

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