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

Demo Data for Everyone

As someone learning about DevOps, I follow a number of people, one of whom is Gene Kim. When I see him get excited about a post, I usually read it. That's how I found this post on Demo Data as Code. It's a short, but interesting read. I think this is actually something more people ought to implement.

DevOps is about reliability and repeatability, among other things, but those two are tackled with automation for a known process. We don't want simple, silly mistakes, or complex ones that might undermine our ability to move forward by creating unnecessary work. Part of ensuring both repeatability and reliability involves data in our databases. This isn't necessarily for demos, though it could be used for demos.

Once of the areas that is often left out of the process is the data that we use in our building our systems. We need data for developers, for QA, and often for demos. In all of those cases, when humans need to repeatedly look at how well the software performs, and want to re-test things, they need some consistent data. I'd also argue that the need for agility means that we need a manageable data set. I think SQL Provision from Redgate is amazing, but I still don't want to always develop with 2TB of masked data. I certainly don't want to demo this for customers from a laptop, and might not want to share this in the cloud.

At Redgate, we sell masking with SQL Provision, and it supports most of the process that's outlined in the Demo Data as Code article. What it needs, however, is a small set of data that can be masked in a deterministic fashion. What I recommend to most clients is that they build a known set of test data, which could be used for demos. This can include all your edge cases and show off new features. It's helpful for developers, testers, and salespeople, who will always have a known, useful set of data.

This can't be a build it and forget it, much like what is outlined in the article. There ought to be a process to build this dataset, likely from production data that gets sanitized, and then distributed through SQL Provision (or similar technology), backups, or even as a set of scripts in your VCS. Ensure an environment can be hydrated instantly on any platform from dev workstation to sales laptop to QA server. Once you have this, everyone can work on evaluating your software from a known baseline.

And if you find the need for more data, then just add it. You have a process, so add an additional step that will cover the holes you inevitably find.

Steve Jones - SSC Editor

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

Redgate SQL Provision
 
 Featured Contents
Stairway to SQL Server Replication

Stairway to SQL Server Replication: Level 1 - Introduction to SQL Server Replication

Sebastian Meine from SQLServerCentral.com

In this Stairway, Sebastian will be covering the details of SQL Server transactional and merge replication, from understanding the basic terminology and methodology of setting up replication, to describing how it works and how the basic replication processes can be monitored.

Find SQL Server Integer Columns to Make Skinnier

Additional Articles from MSSQLTips.com

In this tip we look at a SQL Server script you can use to determine if you can convert your big integer columns to smaller integer data types to save storage space.

How to stop standardization being a stumbling block in database DevOps

Additional Articles from Redgate

Redgate's Heath Tull discusses ways to standardize team-based development with database DevOps, avoiding standardization as a stumbling block.

Free eBook: Fundamentals of SQL Server 2012 Replication

Press Release from Redgate

Fundamentals of SQL Server 2012 Replication provides a hands-on introduction to SQL Server replication. The book introduces you to the technologies that make up replication, and then walks you through setting up different replication scenarios. When you've finished reading, you should be able to implement your own multi-server replication setup while following the principle of least privilege.

From the SQL Server Central Blogs - Find queries with high memory grants – using Query Store

matthew.mcgiffen 73574 from Matthew McGiffen DBA

I had a server that looked like it had been suffering from memory contention. I wanted to see what queries were being run that had high memory requirements. The...

 

 Question of the Day

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

 

Combining Lists

I have two lists in Python:
>>> a = ["SQL Prompt", "SQL Compare", "SQL Data Compare"]
>>> b = ["SQL Source Control", "SQL Change Automation", "DLM Dashboard"]
I now want to combine these into 1 list, under the variable a, which is a single dimension. Which of these will work?

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)

Moving a Table

I have a developer that has built this table in his own schema on a SQL Server 2017 database:

CREATE TABLE SallyDev.CustomerLoad
(   LoadKey         INT
  , CustomerKey     INT
  , LoadTimestamp   DATETIME2
  , CustomerName    VARCHAR(200)
  , CustomerCompany VARCHAR(200)
  , Status          TINYINT);

They now want me to move this to the ETL schema for further testing with our application. What code will move this table?

Answer: ALTER SCHEMA ETL TRANSFER SallyDev.CustomerLoad

Explanation: The ALTER SCHEMA with the TRANSFER command is used. The target schema is altered, with the transfer specifying the old schema and object. Ref: ALTER SCHEMA - https://docs.microsoft.com/pt-br/sql/t-sql/statements/alter-schema-transact-sql?view=sql-server-2017

Discuss this question and answer on the forums

 

Featured Script

A simple powershell script to look up server hardware and OS information

SQLPals from SQLServerCentral

This is a simple powershell script to query and display hardware and OS information from a remote computer.

It uses CIM (Common Information Model) that is available since Powershell version 3 so as long as you have version 3 and up, you should be able to run this script against any server that you have access to.

# Specify the server name here

$server = "Server1"

# pull all the information
$hardware = Get-CimInstance -ClassName Win32_ComputerSystem -ComputerName $server
$OS = Get-CimInstance -ClassName Win32_OperatingSystem -ComputerName $server
$CPU = Get-CimInstance -ClassName Win32_Processor -ComputerName $server
$PhysicalMemory = Get-CimInstance -ClassName CIM_PhysicalMemory -ComputerName $server
$Bios = Get-CimInstance -ClassName Win32_BIOS -ComputerName $server

# build custom array to get some key properties in a single row
$server_summary = New-Object PSObject

Add-Member -inputObject $server_summary -memberType NoteProperty -Name Manufacturer -value $hardware.Manufacturer
Add-Member -inputObject $server_summary -memberType NoteProperty -Name Model -value $hardware.Model
Add-Member -inputObject $server_summary -memberType NoteProperty -Name HypervisorPresent -value $hardware.HypervisorPresent
Add-Member -inputObject $server_summary -memberType NoteProperty -Name Bios -value $Bios.Name
Add-Member -inputObject $server_summary -memberType NoteProperty -Name OS -value $OS.Caption
Add-Member -inputObject $server_summary -memberType NoteProperty -Name OSArchitecture -value $OS.OSArchitecture
Add-Member -inputObject $server_summary -memberType NoteProperty -Name CPUs -value $CPU.count
Add-Member -inputObject $server_summary -memberType NoteProperty -Name PhySicalMemory_GB -value $total_memory_gb
Add-Member -inputObject $server_summary -memberType NoteProperty -Name OSVersionNumber -value $OS.Version
Add-Member -inputObject $server_summary -memberType NoteProperty -Name ServicePackMajorVersion -value $OS.ServicePackMajorVersion
Add-Member -inputObject $server_summary -memberType NoteProperty -Name ServicePackMinor -value $OS.ServicePackMinorVersion
Add-Member -inputObject $server_summary -memberType NoteProperty -Name LastBootUpTime -value $OS.LastBootUpTime

# Display the data on the screen

# But first, lets up the buffer size so we can see the complete output on the screen
$Host.UI.RawUI.BufferSize = New-Object Management.Automation.Host.Size (500, 3000)

"summary"
"======="

$server_summary | ft -AutoSize

""
"Detailed Properties"
"==================="

"Hardware:"
$hardware | ft -Property *

"Bios:"
$Bios | ft -Property *

"Operating System:"
$OS | ft -Property *

"CPUs:"
$CPU | ft -Property *

"Physical Memory:"
$PhysicalMemory | ft -property *

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 - Administration
Can't add user to db_owner role - I have a simple SQL Server 2017 database in which I am unable to add one of the database users to the db_owner role.  I have confirmed the user is actually setup in the database.  When I try to add it to the db_owner role from my own machine, using SSMS or t-sql, I get […]
SQL Server 2017 - Development
In-Memory OLTP - N00b Question - I am new to the In-Memory OLTP world (yes, I am a little behind the times, mock me if you must :)) My question is the following: If I have a time tracking which is written most often but has occasional updates applied. Data is not deleted. Would these tables be good candidates for In-Memory […]
SQL Server 2016 - Administration
Getting counts before deleting data - Hi, I'm working on data archiving to Archive database from source database. I have to insert data from source database table to archive database and then delete from source. But I want to perform a check by getting no.of rows inserted  is equal to no.of rows that are selected to delete. Table1 is parent table […]
Access and rights - Vendor app is requesting for db_owner role to do some development, when I asked for the reason for db_owner then they requested the following access for development. Rights to execute following actions. Table creation, Stored procedure, trigger creation, Views creation and rights to drop, delete and truncate tables. Creating reference And may be some activities […]
How to identify if data is skewed in a table - Hi, I'm seeing key lookup which is taking 95% of time for a query. I have verified and made sure that there is no index fragmentation and stats are up to date. Still the query is taking almost 8 seconds to complete. I want to check if the tables are skewed with data ? How […]
Login error with AD authentication remotely with SSMS - Hello all, I am getting this error on one of our servers and only when logging in remotely with a Windows AD account . Local SQL auth works fine. All ports are open but something is blocking it somewhere on the server please see capture. "The target principal name is incorrect. Cannot generate SSPI." […]
misaligned log IOs - While restoring a log on a secondary replica to prepare a database for joining an availability group I suddenly received a flurry of 'There have been n misaligned log IOs which required falling back to synchronous IO' messages. In 20 years working with SQL Server this is a completely new message to me. A Google […]
Administration - SQL Server 2014
Migration Project - Hi This is the first time I've had to migrate a mission critical 30 vCPU SQL VM from 6 year old VMWare hosts ( Dell R920s I think ) to new Nutanix kit ( the Nutanix spec as yet unknown - but I will post back as I get it ). The SQL app is […]
SQL 2012 - General
Build Failed for SSIS Solution in VS2017 - We have our SSIS solution up and running in VS2012, and we want to migrate to VS2017. But when we open the solution and do a build on VS2017 (Version - 15.9.14), without changing the target server or any settings, the build failed with the below error message. Current version running and built successfully in […]
Performance Improvement Tips - Hi, When you are handed over an environment and have to do performance improvement. What would you do? I know you may be thinking first why do  you need or thinking about improvement. I mean if is just to check if we can make it little more faster. Couple of things I am doing CPU […]
SQL Server 2012 - T-SQL
Dual Duplicates redress. - I have created a stored procedure that pulls personal information from several tables. The output is formatted into XML. I need to manipulate two of the elements to be. I have written a sub-query to return the duplicates within two data fields.I read the base query into INSERT INTO #temp_dups SELECT [RowNumber], [Party], [EID], [BID], […]
Reporting Services
Help issue with iif and basic mathematical functions - Now this seems simple but its driving me up the wall for something that seems so simple. I am attempting to preform an mathematical action on using the value from a text box in a table within an iif statement, for example if the value in textbox1 is numeric then display the value of textbox1 […]
SSRS 2017 Fresh Install - First I know this is the wrong place but SSRS 2017 does not appear as yet, so........ Fresh install on SSRS, build 14.0.600.1274, all went well until trying to trying to connect and then get the error (from the logs\) "Could not find stored procedure 'GetAllFavoriteItems'" and beyond that stuck, any ideas?
Analysis Services
Model with unrelated tables - Today I came across a modeling that I did not understand. I opened a data warehouse project with the following tables: Dimensions: - Dim_Store - Dim_Date - Dim_Customer - Dim_Location Fact: - FactSales The fact  FactSales is relating to the above dimensions, so far ok. But when I open the project in SSAS there are four […]
Integration Services
VisualStudio/SSIS - Exporting from MySQL to MSSQL using ADO.Net connector -Fail - Hi, I'm in the process of creating a package that will export X data from a table in MySQL and import into an almost identical table in MSSQL. I have successfully configured the connection to MySQL using a '.Net providers\ MySQL Data Provider' and can connect to the DB fine. I have also successfully configured […]
 

 

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

 

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