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 your body and be grateful for what it can do.

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.

Checking Up on Vendors

Many years ago I was in the Denver airport, waiting to board a plane. At the time I was consulting with a small startup company and they called me in a panic, having had an issue with their database deployment and needing to restore the previous version. However, they were getting the " The media set has 2 media families but only 1 are provided. All members must be provided." error. Fortunately, I knew what was wrong and verbally walked them through the process. When I landed, I logged in and verified things were working and they've followed my instructions.

A few years later I was shopping for furniture with my wife one Saturday night and I got a call from a fellow Operations person at JD Edwards. They had some security issue with a SQL Server, and since I was the SME (subject matter expert), they called me for help. Sitting in a comfy lounge chair (which I never purchased), I helped them solve the issue. Later, I verified things were working.

In these cases, I was using remote hands from trusted individuals at an organization. However, these days, many people call cloud vendors (or other hosting companies) for the same type of remote hands support, but without necessarily having the accountability from that staff. Sure you can check if they solved an issue, but are you sure they didn't read some data or change anything else?

It's a concern, but it's one that I think can be solved with help from vendors. Microsoft recently announced there's an audit capability for Azure SQL Servers, allowing customer to determine what actions Microsoft support engineers might take on your system. Since we may not necessarily see what is happening when someone else is working on our PaaS or IaaS systems, it's good to have something tracking their moves. I don't know this gathers all queries run, but it certainly should.

I've seen some presentations on how customers have to authorize engineers in VMs with Customer Lockbox, and the technical details are interesting. These are time limited and audited access controls to ensure that customer are aware when a Microsoft employee touches their systems. I don't know if this is comprehensive enough, but it is a good start.

Over time, more and more of us have to delegate some work to others, either inside or outside of our organization. We need strong controls and good tools to ensure that we can determine what happened, especially in the event of some incident taking place. Building these controls is important, and really, they should be easily enabled in all our systems. While I don't know we have a lot of rogue employees accessing things, we do have some, and we have more that make mistakes. Auditing their actions should be something we can easily do.

Steve Jones - SSC Editor

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

 
  Featured Contents

Understanding CRUD Operations on Tables with B-tree Indexes, Page-splits, and Fragmentation

Mohsin_A_Khan from SQLServerCentral

Introduction Every DML transaction reads the data before it makes any changes. Not only during a SELECT query, but when you run any DML statement, insert, update, or delete, SQL Server first fetches a bunch of pages into the buffer pool locating the desired rows and changes them while synchronously writing to the transaction log […]

SQL Server Sequence Numbers

Additional Articles from MSSQLTips.com

In this tip we look at the Sequence Number feature in SQL Server and compare it to the use of identity columns.

Running Dynamic Code Quality Checks on Flyway Databases: Table Smells

Additional Articles from Redgate

How to extend the range of SQL code analysis, during database development, to include dynamic analysis of the database metadata. This will allow regular checks for problems with the design of your tables and indexes ("table smells") that can affect database performance and data integrity.

From the SQL Server Central Blogs - #PowershellBasics: Setting a variable vs a comparison.

Kenneth.Fisher from SQLStudies

In SQL Server both the set and equality functions are handled by the equals sign (=). For example: Set Equality ... Continue reading

From the SQL Server Central Blogs - Expanding Inclusion and Diversity – Better Linking

Steve Jones - SSC Editor from The Voice of the DBA

I’m a native English writer/speaker. Some might debate how well I really know the language, but I am a native. I wasn’t a good student of languages. I struggled...

 

  Question of the Day

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

 

The Number Subquery

I have this data in a table:
gapID ----- 1 2 3 4 6 7 8 10 14 15 16 17
If I run this code, what values are returned?
SELECT gapID FROM gaps AS g1 WHERE NOT EXISTS (SELECT gapID FROM gaps AS g2 WHERE (g2.gapID = g1.gapID - 1)) ORDER BY gapID

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)

Container Images

I've installed Docker on my Windows workstation. I want to get a list of the images that are downloaded to my local machine from which I can create containers. What command should I run? (choose 2)

Answer: docker images, docker image ls

Explanation: Either "docker images" or "docker image ls" will work. "Docker image" will give you help asking for another command. Ref:

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
SQL Server Collation - I have 2 node in an availability group which has been configured for the wrong collation. Now, I would like to change the server collation. No user db's are attached. So I am thinking to remove the availability group and then re install the sql server with right collation on the same server. Is that […]
Does creating memory-optimized tables require a lot of extra DBA support? - if I make 2 largest tables in our most transactional database a memory-optimized table with a columnstore index. or just a memory-optimized table -- how much additional DBA tasks/maintenance/awareness (of what?) should be expected? Compared to regular tables. And 2nd scenario: if we do same to all 50 tables (smallest is 2 million rows) in […]
SQL Server 2016 - Administration
Identify Indexes hurting performance - Is there a way of knowing Indexes: Which are not being used/used rarely ? Which are hurting performance ? Are there any predefined benchmark to mark an index as "good or bad or unused" ? Can we automate this process of identification. Ex:Like generate a weekly report of these 'bad' indexes. Thanks  
SQL Server 2016 - Development and T-SQL
SQL 2016 - Need help with complex calculations based on paycodes ! - Hello Friends, I 'm in need of some SQL help please, I have SQL examples below with the following conditions: All REG plus SICK hours cannot exceed 40 hours in that week. The calculation for REG hours is: total no. of hours in a Cost Center Divided By Total REG Hours regardless of Cost Center  […]
SQL Server 2012 - T-SQL
Dynamic Alert query - Hello, I have a requirement to send an Alert based on Silo Level data , when it hits  <= 30% This is more a process design question....I've  created a view of  silo level data, which is  called by a Power automate flow,  scheduled every hour to run. which is working well. except the problem now […]
SQL Server 2019 - Administration
SQL 2014 and above the Agent job text logs - how to redirect? - For each of our backup jobs in SQL, they are management jobs as SSIS, when they run they create text log files each datecoded. How/where do I make the change to redirect them (each job individually) to a different drive/folder? I looked at the SSIS package, the Agent job itself but can't find it.   […]
extended events bulk copy process - Trying to setup an extended event to capture bulk copy process. Was able to successfully capture some external applications but when I run manually the bcp command on server,  the event is not captured. Also, when run on ssms the bcp command using xp_cmdshell it fails to capture the event. Not sure what I am […]
SQL Server 2019 - Development
XML Parsing Problem - I need to parse the following XML file into columns and rows: 147 1 A 2 1 A 13 I am using this query: SELECT Data.Col.value('(./PartyID)[1]', 'int') As Party_ID, Data.Col.value('(./CampaignID)[1]' , 'int') As Campaign_ID, Data.Col.value('(./Arc)[1]', 'varchar(1)') As Arc, Data.Col.value('(./TicPosition)[1]', 'varchar(10)') As TicPosition FROM @UsageFile.nodes('/PartyID/CampaignID') As Data(Col) […]
Database alert if no data added - Hi friends, I’d like to have your help. I have a SQL Server database, and a table dbo.OnData on it. I would like to receive an email alert from my database if: - within a range of 30mins from 8:00:00 a.m. opening time and default time per day - AND 30mins after the time of […]
Inserting a words from a range randomly into a table - Im in the process of creating test data Now I have a field in the test data called SerialNo this has the following allowed values  '111111','222222', '333333','444444','555555','666666' Now I want to be able insert rows randomly into a target table which can take any one of the values above but im not sure how to […]
How to find unique values in a table - Hello trying to find unique values on the following table First temporary table  query (Master Data) insert into #tempCOO select sk.CountryOfOrigin,im.partnumber,sk.Quantity,sol.id,lp.id,lpl.id,so.id,p.SerialNumber FROM  sk join  lpl on sk.LoadPlanLineId = lpl.id join  lp on lp.id = lpl.LoadPlanId join  sol(nolock) on sol.id=lpl.SalesOrderLineId join so on so.id=sol.SalesOrderId join im on im.id = sol.itemmasterid join pd on pd.content = sk.batchnumber […]
General
Variables - DECLARE @Var1 INTEGER = 12 DECLARE @Var2 SYSNAME = '@Var1' Is there any way to get 12 from @Var2? Thanks! P  
Powershell
Load .sql from folder - I'm using this process to load a folder full of .sql files there are Stored Procedures that I would like to add to a Newly created DB. It runs into errors but doesn't log with .sql file it had a problem loading. Any help finding which ones loaded and which failed in some sort of […]
MySQL
How to normalize? - Hello, friend. Excuse my bad English I'll try to explain my question. So, there is an example of database below. Currently i'm working on a bit more complicated DB, and i have created this example just for better (and fast) understanding of essence of the task. Imagine : we have some store.. In this […]
Microsoft Access
ODBC and use of output clause - i am at a loss and this is only forum that i know of. i am using AcuXDBC (genesis odbc) and am needing to gather output of a insert statement. i have tried to use insert into tablea values ('record one') @output record_number but i get a syntax error no matter what i try regarding […]
 

 

RSS FeedTwitter

This email has been sent to [email protected]. To be removed from this list, please click here. If you have any problems leaving the list, please contact the [email protected]. 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.
[email protected]

 

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