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

Daily Coping Tip

Looking back at the pandemic, what are some pictures that are happy memories

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.

The Usefulness of Database Features

SQL Server is constantly growing and changing, as are most database platforms. There are lots of platform changes, among them enhancements to the T-SQL language. Microsoft has added window functions, in-memory structures, the ability to execute code in other languages, and more. Some of these features are well built and some need more work. What's always interesting to me is what actually gets built and what doesn't.

There was an article recently on evaluating features in an RDBMS, and the article uses the JSON data type in Google's Big Query as an example. The evaluation is interesting, examining whether the feature actually helps the user, or if it is mostly marketing. In this case, the feature is outside of the "normal" conventions of the platform,  but it is useful.

When I look at SQL Server, there are features that I think are well implemented and others that aren't. There are some that are very helpful, but some that don't perform well, at least not at scale. There are also changes that people have requested, but Microsoft hasn't decided to build (please upvote the numbers table).

Many of us use a limited number of features inside the database platforms. We SELECT, INSERT, and UPDATE often, sometimes with the built-in functions, sometimes not. Many data professionals know what to use and avoid, but often developers may assume that any feature added will perform well. Most of them do very well with a few rows of data, but can be problematic at the scale of millions of rows. While we would want all features to work well at all scales, that isn't something that's going to happen.

I accept that some features are there to help customers in different ways. I can't imagine wanting to run Java code from a database call, but some organizations see value in this, so it's a capability in SQL Server. I'm sure some people can't fathom why I think a built-in numbers table is needed when there are easy ways to build one. I guess that's why my priorities, yours, and Microsoft's will differ, at least with regard to what things should change in the platform. What gets built is up to Microsoft.

When you use a feature in any datastore, there may be tradeoffs with other techniques, and there may be problem domains where the feature works well or doesn't. It's important that you understand and learn the limits and advantages of any particular feature. It's also important you know how to adopt a feature when it's better or abandon one when it doesn't meet your needs.

Steve Jones - SSC Editor

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

 
 Featured Contents
SQLServerCentral Article

Chaos Engineering in Azure

Arun Yadav from SQLServerCentral

Chaos engineering is all about breaking your application. Let us see what it is all about and how easy it is in Azure.

External Article

Frustrated with your database monitoring challenges?

Additional Articles from Redgate

Find out how 2500+ of your database professional peers are meeting current and upcoming challenges in our free reports. We cover the Cloud, Security, Growing Environments and the value of monitoring for the entire organization.

External Article

Sentiment Analysis with Python

Additional Articles from SimpleTalk

Python is a modern general-purpose programming language that's very useful for analytics. Sanil Mhatre demonstrates sentiment analysis with Python.

Blog Post

From the SQL Server Central Blogs - You can’t use GO in dynamic SQL.

Kenneth.Fisher from SQLStudies

This is one of those things that when I look back on it seems really obvious. Note: If at the ... Continue reading

Blog Post

From the SQL Server Central Blogs - OLTP Star, Snowflake, and Galaxy Schemas

Steve Jones - SSC Editor from The Voice of the DBA

This is part of a series on my preparation for the DP-900 exam. This is the Microsoft Azure Data Fundamentals, part of a number of certification paths. You can...

 

 Question of the Day

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

 

Data Analytics Classification I

If I am searching for the answers to question about why something happened, what type of data analytics activity am I performing?

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)

Checking the Type Code

What is wrong with this code?

CREATE OR ALTER TYPE LocationParameter AS TABLE   
    ( LocationName VARCHAR(50)  
    , CountryCode CHAR(3)
    , INDEX IX_CountryCode (
CountryCode
)
 );  
GO  

Answer: There is no CREATE OR ALTER syntax for TYPEs

Explanation: You cannot alter a user-defined type. There is only CREATE syntax. There is no ALTER syntax, either. You can add indexes, and commas or schemas are the same as any other statement. Note: There is a feedback item for voting to get this fixed.

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
Migrating 2012 database to 2017 instance - compatibility level question - Hi Restoring a backup of a 2012 database to 2017 instance and will copying over logins and Jobs using scripts, just wondering what I do with compatibility level of the database once its restored over to the 2017 instance.   thanks in Advance Caz100
SQL Server 2016 - Administration
how can I get param passed to specific SP procedure - Hello, I'm looking to optimize Store procedures which run hundreds of times in a day and see if I can optimize them in anyway by checking there execution plan and code. I have sample param for couple of SP..but how can I get  param used for running any store procedure. There should be some trace […]
MEMORY_ALLOCATION_EXT - I have a sql2016 (Std) VM box with 16gig of memory when I run the posted query I see this wait type, and wondering how to research more what I'm seeing and how to fix. The queries are select statements in the "executing SQL". Sql is using around 9gig and 11gig is allocated of the […]
SQL Server 2016 - Development and T-SQL
lead and lag records - Hi Expert, I am facing multple 0 value records and needs only expired and active records i.e. 0 ,1 for below table. Added sample table for your reference div idCustomerID Div_Status LogDate -1 -1 0 18-01-2022 -1 -1 0 19-01-2022 -1 -1 0 20-01-2022 -1 -1 0 22-01-2022 -1 -1 0 23-01-2022 -1 -1 1 […]
Slowness in query of target data - Hello experts, I'm trying to write a query to convert event session target data to a more readable SQL recordset, following this Brent Ozar example, among others: https://www.brentozar.com/archive/2015/01/query-extended-events-target-xml/ I set up an event session to capture the TLS version used for client connections based on the info here: https://www.sqltreeo.com/docs/find-out-which-tls-version-is-used-for-sql-server-connections -- Insert data into temp table. […]
SQL Server 2019 - Administration
Proxy accounts failing to authenticate intermittently - We've recently moved a couple servers to SQL 2019 running on Windows Server 2019, these were previously on SQL2016/Win2016. We started getting jobs that failed to start due to authentication issues with proxy accounts (credentials). Only happens once a day or every few days. Not related to any specific job or proxy account and not […]
Log shipping broken after application upgrade - I have a weird situation regarding log shipping.  We back up the databases on our production database server every hour, and then restore to our reporting server.  This has been running for years. Last weekend, we upgraded our accounting system, and afterwards, log shipping stopped on the databases that the accounting system users.  There is […]
SQL Server 2019 - Development
Data visualization tool - Hi everyone I am looking for a good data visualization tool to see my data.  I do not want a pay per month type of product.  I am ok with paying for a perpetual license or free.  Can someone help me with some product suggestions? Thank you
Join of dates field of 1 table and add +7 days to join to a different table -   I have two CTEs. From one UDT_CKB_SNAPSHOT I am taking Event Names, from the 2nd CTE called FCSTPERFSTATIC I am taking Forecast and Actuals. I connect those two tables on Unit#, Location and Startdate. And everything is correct. However, I need to add 2 more columns namely 'Forecast for the 2nd week' and 'Actuals […]
What am I doing wrong with this subquery? - I am trying to return all values from the lookup table to columns on the same row for the Diagnosis code.   Here is my query: SELECT distinct a.accession_no as "Accession Number", (ISNULL((select m.code from medical_code m where ai.icd9_id = m.id and ai.sort_ord = 1), '')) + '~' + (ISNULL((select m.code from medical_code m where […]
cursor not getting next values - I've built this cursor to build a new diagcode from all the values in the cursor. The cursor is working in the sense that it's looping, but it's not getting the next "code" or value in the list. What am I doing wrong? Note: I am selecting a list of codes. then I have declare […]
populate a table with new data set but keep the original identity column values - I have a table like below, I would reset the values in the table with some fake addresses. I have already have the fake addresses ready without identity columns. But I would keep the original addressID in the table, so that other table use it as FK still works. Basically I want to keep the […]
Reporting Services
How to group the data by student name and display data in multi level - I am having the data as follows DECLARE @Student TABLE ( StudentId INT, StudentName NVARCHAR(200), StudentRollNo NVARCHAR(20) ) INSERT INTO @Student VALUES (1, 'GDOVFKMIZS', 'S12345'), (2, 'QXAKWOYMRZ', 'X1256') DECLARE @StudentHistory TABLE ( StudentId INT, Remarks NVARCHAR(500), StartDate DATETIME, EndDate DATETIME ) INSERT INTO @StudentHistory (StudentId, StartDate, EndDate, Remarks) VALUES (1, '2021-01-01', '2021-03-28', 'Test Remarks'), (1, […]
SSRS Long Text 2 Column report with some variables - I need to design what looks like a simple report.  However, it's 29 pages or so, 2-column, with a few variables mixed into the long text with various formatting throughout.  It seems simple enough.  However, I'm not sure how to even begin. I have the data set setup without issue.  I also have my parameters […]
Design Ideas and Questions
Need some example or answer for this doc - Need answer or data sample for this exam CMSC424 - Database Design SQL Assignment (Parts A and B) Fall 2007 (TENNIS DB SCHEMA) I trying test some tennis db like this doc, if someone has example with data test sample for test. https://ufile.io/dih6vn9a  
 

 

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

 

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