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

The GDPR is Coming to the US

Over the last year or so, I've been working on understanding the General Data Protection Regulation (GDPR) that is the data privacy law in Europe. This has been law for a couple years, but enforcement just started in May of 2018. Along the way, I spent time looking at other countries and the various types of data protection laws they've enacted or are preparing. The US was included in this research, though in a woeful, sad way. 

The US hasn't had much in the way of data protection, at least not at the national level. Since the US is a large market, many of us wondered if their reluctance would influence the rest of the world to care less about data protections or even weaken the GDPR by attracting more business away from Europe. That would be disappointing, as I think the state of data security, protections for humans, and privacy rights are extremely poor in the US.

At the state level, New York introduced the SHIELD Act, though it hasn't been passed.  Most other US states aren't working on anything, but California has actually passed a law, similar to the GDPR. I'm happy to see this, and my hope is that this pressures Congress to pass something that will apply to all 50 states. However, even if they don't, perhaps California will influence the rest of us. I suspect many companies will want to do business in the state, but not want separate rules for one state v others, so they'll just adopt CA standards.

The bill was a little rushed, in part to head off a ballot initiative. Whether this is good or bad remains to be seen, but plenty of the large technology companies don't like it. Google and Facebook for sure, but I'm sure many tech companies that make profits from collecting, analyzing, using, and selling data are going to be upset. This could cause issues with their business models, and my guess is they'll fight any fines and appeal court rulings for years.

Personally I understand there is business value in data, and there are plenty of good uses of data. What I don't like, or appreciate, is companies looking for new ways to gather data on me without limits, and certainly without my consent or understanding. We don't really know how valuable and potentially dangerous data is about each of us, and we ought to have some rights and control over it's use, storage, and retention.

Whether this will change our work as data professionals remains to be seen. My guess is we might finally get to treat data as not only an asset of the company, but as an asset of individuals that we need to safeguard and protect.

Steve Jones from SQLServerCentral.com

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

Database DevOps

Database DevOps Demo Webinar

Learn how to automate your database deployments alongside your app code in this free demo webinar. Register now


How DevOps can help you stay ahead of the competition

Join SQL Server Central Editor Steve Jones and Octopus Deploy Solution Architect Bob Walker, to discover how taking a DevOps approach paves the way for staying ahead in business
Register now

Featured Contents


Installing SSDT and creating your first SSIS Package

Kumar Attangudi Perichiappan Perichappan from SQLServerCentral.com

SQL Server Data Tools (SSDT) is a toolset which provides an environment for you to carry out all your database design work in SQL Server. It can be used to build to build SQL Server relational databases. More »


Help Redgate do a better job (and win a $250 Amazon voucher)

Could you spare a few minutes to help Redgate improve its products and services? They’re running a survey of their users and the wider SQL Server community and they’d appreciate your insights. As a thank you for taking part, you’ll also be entered in a prize draw for a $250 Amazon Voucher. More »


Azure and Windows PowerShell: Getting Information

Additional Articles from SimpleTalk

In the second part of his series, Nicolas Prigent describes in detail how to automate the login process using PowerShell and Azure CLI. Nicolas also explains how to retrieve information about your Azure subscription. More »


From the SQLServerCentral Blogs - Does a Primary Key always have stats_id 1?

Wayne Sheffield from SQLServerCentral Blogs

Back to the SQL Server Basics with Wayne The Myth I recently was attending a presentation where the presenter stated that the... More »


From the SQLServerCentral Blogs - Azure SQL Elastic Pools – Moving Databases

Arun Sirpal from SQLServerCentral Blogs

If you read official Microsoft documentation about naming conventions for your SQL elastic pools, it is hard to find any... More »

Question of the Day

Today's Question (by Steve Jones):

I need to split a string into separate items. I have a string and some code that I am experimenting with. I don't want to 
DECLARE @cars VARCHAR(200) = 'Porsche, Ferrari, Bentley, Jaguar,Range Rover'
 FROM STRING_SPLIT(@cars, ', ')
What happens?

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: STRING_SPLIT().

We'd love to give you credit for your own question and answer.
To submit a QOTD, simply log in to the Contribution Center.


Extract, Transform, and Load with SQL Server Integration Services: With Microsoft SQL Server, Oracle, and IBM DB2

Readers will learn by example how to use Microsoft SQL Server 2016 Integration Services (SSIS) as they design and implement extract, transform, and load (ETL) solutions to support a business application that integrates with a data warehouse and an online Web store across a heterogeneous system. This volume describes proven methods to support common ETL needs, such as databases communicating directly with each other, using files to exchange data, or performing database operations using Web services.

Pick up your copy of this great book today at Amazon today.

Yesterday's Question of the Day

Yesterday's Question (by Steve Jones):

When I create a new Azure SQL Database, must I include this in a resource group? Assume I am not using the classic deployment method.

Answer: No, but this will exist as a part of a default resource group for your subscription


The classic model for deploying Azure resources did not include grouping. However, when the Resource Manager was introduced, Resource Groups were added and all resources were added to a default group.

Now if you choose the classic deployment model and create resources without a resource group, they are still added to a default resource group.

Ref: Azure Resource Manager vs. classic deployment: Understand deployment models and the state of your resources - click here

» Discuss this question and answer on the forums

Featured Script

Transactional Logs Restore

Harsha Bhagat from SQLServerCentral.com

As a DBA, we have to test our backups with restore testing. 
To test the restore manually it does becomes a bit of lengthy process. 
To ease out the process of copy and pasting all the files what we want to test the restore the procedure will help.
1. Please restore the database and leave the database in non-recovery mode. 
2. Copy all the transaction log files into one folder location and make sure that the service account has correct permission to read and write the files. 
3. execute the procedure as below.
    DBA_Restore_TransactionLog 'DatabaseName', 'S:\backup'
If error happens like below 
Server: Msg 4305, Level 16, State 1, Line 1
The log in this backup set begins at LSN 2413977000000004100001, which is too late to apply to the database. An earlier log backup that includes LSN 2413630000000004100001 can be restored.
Server: Msg 3013, Level 16, State 1, Line 1
RESTORE LOG is terminating abnormally.
To know what files were picked up use the table Temp_FileList
Id          Dates                Times                Filenames                                                                                                                                                                                                                                                        
----------- -------------------- -------------------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
1           23/06/2018           08:00                DBName_20180623_080002.trn
2           23/06/2018           07:19                DBName_20180623_071904.trn
3           23/06/2018           07:18                DBName_20180623_071442.trn
4           23/06/2018           07:06                DBName_20180623_070609.trn
5           23/06/2018           07:06                DBName_20180623_070613.trn
6           23/06/2018           07:01                DBName_20180623_070007.trn
7           23/06/2018           06:00                DBName_20180623_060003.trn
8           23/06/2018           05:00                DBName_20180623_050002.trn
9           23/06/2018           04:00                DBName_20180623_040003.trn
To see what the procedure has executed, use the table Temp_ExecuteFileList
select * from Temp_ExecuteFileList
 RESTORE LOG Vectus_stoke   FROM disk = 'F:\backup\DBName_20180623_000002.trn'    WITH NORECOVERY;
 RESTORE LOG Vectus_stoke   FROM disk = 'F:\backup\DBName_20180623_010003.trn'    WITH NORECOVERY;
 RESTORE LOG Vectus_stoke   FROM disk = 'F:\backup\DBName_20180623_020002.trn'    WITH NORECOVERY;
 RESTORE LOG Vectus_stoke   FROM disk = 'F:\backup\DBName_20180623_030002.trn'    WITH NORECOVERY;
 RESTORE LOG Vectus_stoke   FROM disk = 'F:\backup\DBName_20180623_040003.trn'    WITH NORECOVERY;
 RESTORE LOG Vectus_stoke   FROM disk = 'F:\backup\DBName_20180623_050002.trn'    WITH NORECOVERY;
 RESTORE LOG Vectus_stoke   FROM disk = 'F:\backup\DBName_20180623_060003.trn'    WITH NORECOVERY;
 RESTORE LOG Vectus_stoke   FROM disk = 'F:\backup\DBName_20180623_070007.trn'    WITH NORECOVERY;
 RESTORE LOG Vectus_stoke   FROM disk = 'F:\backup\DBName_20180623_070613.trn'    WITH NORECOVERY;

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 2017 : SQL Server 2017 - Administration

Avoid bulk data export - Dear all, I have this information from my company:

SQL Server Dependencies - Hi All, Today we encountered a issue with SQL Server services. After upgrading TLS 1.0 to TLS 1.2, SQL Server Services are...

SQL 2017 FCI with File Share Witness - permissions? - I have Win2016, SQL 2017 FCI with 2 node non shared storage using Always On AGs.  I have a separate...

SQL Server 2017 : SQL Server 2017 - Development

Difference between minimum and maximum value - Hi , I have a table with Loannumbers , and each Lonnumber has different Price for each date( something like market value...

SQL Server 2016 : SQL Server 2016 - Administration

A Stairway series on Performance Tuning would be amazing! - Hi all I didn't know where to post this so just posting this here. I know it's a big topic with...

High availability solution - Hi Please suggest best high availability disaster recovery  solution for sqlserver2016 standard edition on windows server 2016 standard edition. Is the Logshipping ...

CmdExec to delete files not working - I'm using Ola Hallengren's maintenance solution with this command to cleanup old output files. However, it is not working. It...

error sql server - Hello everyone Who can help me about this error please Error generation on DB Side : System.Data.SqlClient.SqlException: Table error: table 'TLOG.ITEMS' (ID 494624805). ...

SSMS 17.6 connecting so SSIS 2016 - I am getting an error when trying to Integration Services using ssms 17.6 (The specified service does not exist as...

SQL Server 2016 : SQL Server 2016 - Development and T-SQL

Database Audit -

Stored Procedure - I have an existing business database with tables and was wondering if someone could help me create a stored procedure.  The...

Expression Builder - Default to 2 Saturdays ago - I'm building a SSIS pkg that runs every Monday; it picks up a .csv file from a share which gets...

SQL Server 2014 : Administration - SQL Server 2014

Database Snapshot Woes - Hi Guys, So I have a snapshot on a DB taken about 6 days ago. I also have another snapshot taken...

SQL Server 2012 : SQL Server 2012 - T-SQL

Query help for inserting data - Hi I am writing a procedure to move data from one table to another along with some additional fields. here I...

XML nodes help - The XML in the attached file is the XMLTEXT field in my CDRecords table. What code would i use to cross...

SQL Server 2008 : SQL Server 2008 - General

how to get sum of each row and column - I used this code below to query and count the test result of OK,NG and RR. select station_no, count(case when...

Can I run a VBS script in a scheduled SQL Job? - Hi I have a vbs script that runs fine in the command line(It uses CuteFTP to upload a file ) I tried...

SQL Server 2008 : T-SQL (SS2K8)

How to Use xp_dirtree to List All Files in a Folder - hello to everyone, i use the following code to list a filenames in a temporary table.the code runs well when i...

Presenting rows of data horizontally - I have two fields in a SQL Server 2008 view. ID and SubID. There are up to 24 subIDs for...

SQL Server 2005 : CLR Integration and Programming.

How to use bcp utility as process in a CLR procedure ? - I have an CLR project where I use the next procedure : public static int processCMD(string fileName, string arguments) { try { System.Diagnostics.Process...

This email has been sent to {user_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.
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