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

The Problem with Users

I think Troy Hunt is an incredible thinker. His view and work to improve security in infrastructure and applications is incredible and valuable. I think the focus on better passwords and the implications of data breaches has grown in the world, perhaps due to Troy's work with https://haveibeenpwned.com/. Plenty of non technical people know about the site, and more than a few government officials.

Recently I read a piece from Mr. Hunt on passwords and why they will continue to exist for some time. I agree that the understanding and convenience of passwords makes them a tool that will remain widely deployed for some time. I like the additional verification from Google and other sites with a text or message on a phone for MFA (multi-factor authentication), and would love to see that in SQL Server, but this doesn't eliminate the need for passwords. It just adds to them.

The idea of password has a parallel in database development as well. One of the most basic things that we do as data professionals is fix problems on our systems. We do this in various ways, but I'd bet almost every organization has an individual that has made a change in a live, production database. Why? Because it's easy and it needs to be done sometimes to fix code, data, or something else quickly. We know it's not ideal, but it works.

I try to talk about compliant Database DevOps, about having a process, the need for evaluating code and data changes, about limiting access to production, about ensuring every statement is tested elsewhere, about even masking/anonymizing/generating data in dev/test environments. Most of us know these are good ideas, and likely quite a few of us would like to adopt them. Why don't we? Part of it is the ease with which we get things done. Another part is the success that we have with our current process.

We fix things, we add indexes, we correct typos in code, we adjust our deployment to succeed, even though the scripts had problems. We roll forward constantly, coding by the seat of our pants, and for the most part our organizations continue to function well. Brent Ozar's recent survey on production data in development shows that in some cases there isn't a security risk, but quite a few times expediency and troubleshooting mean we work in production or copy data.

I still think DevOps is the better way to move development forward. At Redgate, we have a suite of tools that help you smooth database development to reduce mistakes and problems. Not because you can't be successful the way you are, but because you can go faster, make more experiments and changes, and deploy on demand rather than as a special event. We help you save time, which should translate into your highly paid staff spending time on creative new solutions, not fixing tedious problems. We even expect you'll do things in production, which is why DLM Dashboard was built.

We're not the only vendor doing this. Plenty of others are trying to help you build a smoother database DevOps process, including Microsoft. Most expert software developers know that DevOps is a better way to build software that focuses and takes advantage of the creativity of your developers, while reducing the time spent on non-creative work. I, and many others, feel that the database needs to be a part of this to be as successful as we can be.

Steve Jones - SSC Editor

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

Redgate SQL Provision
 
 Featured Contents

How to Unclog SQL Server

pamelamooney1966 from SQLServerCentral

In this article, learn how one DBA solved a query timeout issue with an application by examining the effects that different temporary objects have on query performance.

Polling and Survey Data Transparency

Additional Articles from Database Journal

Polls and surveys are increasing in use. If you are a DBA, developer, or data scientist, then it is good to understand how to structure your systems for transparency and proper use.

3 ways Managed Services Providers can offer more value

Additional Articles from Redgate

Redgate's Will Sharman explores ways that database MSPs can save time, minimize effort and work more efficiently, while at the same time providing more value to their customers.

From the SQL Server Central Blogs - Learning Powershell with Show-Command

Kenneth.Fisher from SQLStudies

Years ago I blogged about how I like to use the SSMS scripting feature to learn how to do things. ... Continue reading

From the SQL Server Central Blogs - SQL Server Metadata using Powershell

SQLPals from Mission: SQL Homeostasis

If you are new at your job or a new client you would like to gather and review the sql server meta data to understand the environment and get...

 

 Question of the Day

Today's question (by Evgeny Garaev):

 

Restore databases on SQL Server 2017

You have restored a database from a full backup on a SQL Server 2017 instance with NORECOVERY option. Now you need to apply a differential backup. Which T-SQL command would you use?

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)

Finding the username

In Python, I have this code that runs:

>>> str = """EmailAddr,Nickname,Role
... sjones@sqlservercentral.com,Steve,Admin
... webmaster@sqlservercentral.com,Webmaster,Admin
... pressrelease@sqlservercentral.com,Press,author
... """

I now want to use a regular expression to find the username in the email. I run this:

>>> for i in re.finditer('([a-zA-Z]+)@([a-zA-Z]+).(com)', str):
...     print(i.group(xxxx))

What should replace the "xxxx" to get the username from the email address?

Answer: 1

Explanation: The regular expression method, finditer, will break this out to find email address matches. The 0th element in the group is the full match, i.e., sjones@sqlservercentral.com. The index of 1 gets the username, i.e. sjones. The index of 2 gets the domain, i.e. sqlservercentral. The index of 3 is the "com" element. Ref: Regular Expression Operations - https://docs.python.org/2/library/re.html

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 - Administration
TLS 1.2 and Database mail - Hi, We use office 365, and just recently received an email from them saying we had a client using TLS 1.0.  I tracked this down to database mail.  I'm an accidental DBA (more a developer, but now a jack-of-all-trades IT), so don't know about security at all. We have MSSQL 2017 on Server 2016.  One […]
SQL Server 2017 - Development
Group and total by column Name - Guys, How do i group the below by type and date so i have a total for each day for each person by each type. So the desired results should look like: INTO #SampleData2 FROM ( VALUES ('2019-01-01', 'Dave', 'Break', 797), ('2019-01-01', 'Dave', 'Break', 746), ('2019-01-01', 'Dave', 'Break', 511), ('2019-01-01', 'Bethan', 'Break', 631), ('2019-01-01', 'Bethan', […]
What is wrong with my code? - Here is my code: CREATE TABLE ProjectCodes ( ProjectID varchar(22), ProjectName varchar(25), Level char(1), [Project Classification] varchar(14), [Project Type] varchar(11), Billable char(1), DEFAULT 'Y', [Allow Charging] char(1), DEFAULT 'Y', Active char(1), DEFAULT 'Y', [Contract No] char(17), [Task Order No] char(17), CONSTRAINT PK_ProjectCodes_ProjectID PRIMARY KEY CLUSTERED (ProjectID ASC) )   The error message is: Msg 142, […]
SQL Server 2016 - Administration
tempdb space reduction - How  can  we minimize the space utilization  of tempdb when we ran the dbcc integrity/check db  jobs ? we are geeting space issues every week when these jobs are running in weekends. if we choose sort in tempdb =off will it save the disk space  where tempdb resides?
-ExcludeJob with list dbatools - Hello everyone , I would like to transfer job sql lists through dbatools through the Copy-DbaAgentJob command only I want to exclude a list of jobs the lists is a long thank you for your help $Source = 'production\REF ' $Destination = 'localhost' $SharedPath = '\\production\migration' Copy-DbaDatabase -Source $Source -Destination $Destination -Database exploit -BackupRestore -SharedPath […]
How to send queued emails - After an upgrade,   sql server stopped sending emails.   Problem is not solved but during the breakdown some emails were not sent. I can see them with this query: SELECT * FROM msdb.dbo.sysmail_unsentitems; The status is: unsent Is there a way to sent them now that the problem is fixed? thanks
SQL Server 2016 - Development and T-SQL
Long name in TSQL is creating errors - Hello, This will be a simple problem to solve for many of you! I am sure of it I have a script created in SQL agent and when I run it with a simple path it works but not with the long name: SET @path = 'C:\SQLBackup\' SET @path = 'C:\Users\Administrator\OneDrive - My  Company […]
DATEADD(DAY, -30, GETDATE()) - Dear Everyone I wanted to know the statement below will it delete everything in the last 30 days or anything before the last 30 days? DELETE FROM tb_LogIP WHERE MsgLogID IN (SELECT MsgLogID FROM tb_LogGeneral WITH (NOLOCK) WHERE CLF_LogReceivedTime < DATEADD(DAY, -30, GETDATE())) I think this query will delete the most recent data in the […]
Administration - SQL Server 2014
Adding server to Alwayson - Hello Experts, For the first time i got a oppurtunity to work on Alwayson setup at configuration level.Till now already its configured and was maintaining and monitoring the Always on dbs. I am exited to perform below task. As it is a production servers with more than 2TB size i am seeking help from you […]
Development - SQL Server 2014
Left join not pulling all from left table - T has 57,000 distinct rows Z has over a million.  I did row over partition on the key field (Z.zpsh) When i run the following SQL, I only get 47,000 rows back. Shouldn't I get 57,000?   thanks   select * from #temp1 T left join #temp2 Z on T.entry = Z.zpsh where z.rownumber = 1
SQL 2012 - General
Upgrading tables without downtime - Hi, We are in the process of a larger upgrade of an existing database. Basically we are normalizing some of the tables which means we need to copy data from old table(s) to new table(s). The data migration is planned to be done from within an external application that reads from the old tables and […]
SQL Server 2008 - General
how to get 0 if records have empty or null values when column datatype is numeri - Hi I have one doubt in sql server how to get 0 when records have empty or null values when column datatype is numeric in sql server else get max(id) values in sql server Table : empid CREATE TABLE [dbo].[empid]( [id] [numeric](11, 0) NULL ) ON [PRIMARY] GO INSERT [dbo].[empid] ([id]) VALUES (NULL) GO INSERT […]
Reporting Services
Bulk Export of History Reports - We are shutting down a SQL Server and would like to know if there is any way to export the History Reports from Report Manager so they can be saved as either Excel, CSV or pdfs? Any suggestions? The data is being moved to new server however the reports on that new server are different […]
Integration Services
ForEach Loop shows Success before Completing all loops - I have an SSIS package I set up years ago and it always ran fine until recently.   There is a ForEach Loop Container.  Each loop runs a stored procedure (the stored procedure creates synonyms to point to a database), then loads a table from the data in that database.  I have a lot of these […]
How to run package (catalog) from PowerShell with Environment variable in DTExec - Hello Everyone, I am new to PowerShell. I don't even know the basics. I have used the below script and able to run the package successfully. But the problem with this script is it just triggering the package and returning the execution id. Not sure whether the package got succeeded or not. https://docs.microsoft.com/en-us/sql/integration-services/ssis-quickstart-run-powershell?view=sql-server-2017 Later I […]
 

 

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

 

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