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

Daily Coping Tip

Say positive things to the people you meet today

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.

Knowing Your Technologies

Awhile back I ran across a blog post that talks about the difference between database snapshots and database backups. There are certainly some similarities and some differences, as well as an overlap in the places that you might choose to use each of these technologies. Both might be useful as a way to recover from a bad code deployment, but both aren't necessarily helpful for a DR situation where the primary server has a catastrophic hardware failure.

It's often the case that we learn only a bit about some of the technologies in SQL Server. That's understandable as the platform has grown very complex, encompassing a vast array of technologies and options. There is often some overlap between them, and possibly different places where you might choose to use one or the other and solve a problem.

In plenty of cases, one technology will stand out, especially when you have gathered enough requirements to understand the entire situation. More information can help you narrow down your choices, and even make a decision, if you know both (or all) the technologies well.

If.

The key here is that as you look for solutions, you should be sure that you understand the technologies well. Dive deep into each of your choices and make an effort to determine the positives and negatives, the advantages of one over the other, as well as the limitations or holes that may be present. You can work often work around limitations, but you should be aware of what they are.

We can't learn everything today, or even everything that we need to know in a short period of time. However, when we are faced with a situation that has multiple solutions and unfamiliar technologies, we should ensure that we try to learn, ask questions, and do our best to understand the boundaries of the question and the technologies that might solve our problem.

Steve Jones - SSC Editor

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

 
  Featured Contents
SQLServerCentral Article

Technical Considerations for Data Ingestion - Part 2

Sarah from SQLServerCentral

In part 2, we discuss the concepts of structure, tooling, and indexing for your data ingestion pipelines.

External Article

Dealing with the Bits of a Binary Value in SQL Server

Additional Articles from SimpleTalk

In this article, I want to talk about a topic that you may never need. The only time I have really had need to look at the bits in a byte pattern. In (what is now) ancient versions of SQL Server didn't have such self-describing columns like in its metadata objects like it does now.

External Article

Understanding Windows Server Cluster Quorum Options

Additional Articles from MSSQLTips.com

If you're deploying SQL Server, you are likely running business-critical applications on it and you need to ensure it's protected from downtime and data loss.

Blog Post

From the SQL Server Central Blogs - Microsoft SQL Server Management Studio Error

Tim Radney from Tim Radney - Database Professional

I came across an issue with SSMS not loading properly recently. Regardless of launching from the start menu with or without administrator, SSMS would error out. Due to this...

Blog Post

From the SQL Server Central Blogs - Help! My tempdb is full and I can’t access SQL Server!

hellosqlkitty from SQLKitty

I got a call saying the database server is inaccessible because tempdb is full. I get online and try to connect because I want to see the error for...

Transact-SQL: The Building Blocks to SQL Server Programming eBook by Gregory A. Larsen

Transact-SQL: The Building Blocks to SQL Server Programming by Gregory A. Larsen

Greg Larsen from SQLServerCentral

Transact SQL (TSQL) is the languaged used to query and update data stored in a SQL Server. This book, written by SQL Server Central and Simple Talk author Greg Larsen, will give developers an understanding of the basics of the TSQL language. Programmers will have the building blocks necessary to quickly and easily build applications that use SQL Server.

 

  Question of the Day

Today's question (by tomaz.kastrun):

 

Rounding in Python

What is the value of variable val3  (print command) in this Python code?
import math as m val1 = round(m.sqrt(650.25),-1) val2 = str(val1) val3 = val2[-3] print(val3)
 

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)

Detecting the Variable Type

If I have a variable, and I want to get the type programmatically from T-SQL, what should I do?

Meaning, I have a variable that gets assigned as the result of a function call:

select @a = somefunction() 

Which T-SQL function can I use to determine the base type, precision, scale, and length of @a?

Answer: SQL_VARIANT_PROPERTY()

Explanation: Of these, only SQL_VARIANT_PROPERTY is a valid function. This is used with a property type to get the base type, scale, precision, bytes, collaction, and max length from a variable. Ref: SQL_VARIANT_PROPERTY() - https://learn.microsoft.com/en-us/sql/t-sql/functions/sql-variant-property-transact-sql?view=sql-server-ver16

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 2016 - Administration
Job History says running, but Job Activity says idle - Hello experts, I'm hoping to get help with a strange issue. I got a request to stop a long-running SQL Agent job. The client correctly sees that the job history says the job is running. But when I checked the Job Activity Monitor, it says the job is idle and last succeeded at such-and-such a […]
Change Data Capture - We performed a drop on one of our CDC Tables when we should have performed a sp_cdc_disable_table .  Now when we try to create the CDC Table via sp_cdc_enable_table and specifying the @Capture_Instance name we get the following error: Could not create a capture instance because the capture instance name ' ' already exists in […]
SQL Agent Job Notification - Hi - I have maintenance plan that rebuilds indexes nightly on a specific database. In its related SQL Agent Job properties I have set to email when the job fails like so: But I'm getting notifications on Success as well. Any ideas?  
SQL 2012 - General
60 Second Rolling Avg With Different Starting Points - Hi, I have a table with columns: jobId, timeStamp (for duration per jobId) and tempData (see attachment). I have created a query that calculates 60 second rolling average by jobId. (you can see it at the end of the post) Where I am struggling is adding two additional rolling averages. Both of them would be […]
SQL Server 2019 - Administration
Using DNN (Distributed Network Name) for on-prem AOAG - Hi we have a hybrid SQL estate between om-prem and Azure. It's been suggested that we should configure our AOAG's with DNN's both in Azure and on-prem so everything is using the same solution. DNN's on Azure look to be a good solution but I can't see anything (apart from details of edition and CU […]
SQL Agent Job doesn't write output - Dear All, I have set up a consistency check job on an SQL server which runs well but doesn't write the output. thank you in advance.   Best Regards....Arshad
SQL Server 2019 - Development
Sql stored procedure to select top 1 from multiple tables and update 1 table in - I have two tables in this format below; Table Transfer Id  Stage  Amount  TransactionNumber  bnumber Table User Id  Bnumber  FirstName  FirstLastName My aim is to select top 1 from these tables based on criteria and then update that record in the Transfer table, all in one query. I have struggled and came up with the […]
SQL Query to fill in Null Column values based on closest date to a given date - Greetings, I am trying to fill in NULL  values in a column (Advice) with the value from the closest date (higher or lower) with the same id. Hopefully my example will illustrate this. The table below has two id types (CustId and LeadId) and one will always be null if the other has a value. […]
multiple same dates - Hi Expert, Have 2 columns where column A which is id having multiple duplicate records this is my input records and output is mentioned below create table table1 (id varchar(20), b varchar(20), c date) insert into table1 values('-1','ww','2022-05-24'), ('-1', 'ff', '2022-05-24'), ('1', 'ee', '2022-05-25'), ('1' ,'ww', '2022-05-25'), ('2', 'ff', '2022-05-26'), ('4', 'ww', '2022-05-27'), ('4', 'ff', […]
Cant extract values from JSON Array - Hi there I am trying to extract values from a JSON array object but struggling so my code is as follows: DECLARE @JSON NVARCHAR(MAX) = '{ "ChannelIDs": [11,14,15,16], "SerialNumber": "939029", "ReadingStartDate": "2022-05-20T13:49:13", "ReadingEndDate": "2023-01-09T17:44:05", "Amount": 50, "SortOrder": "Ascending", "IncludeFirstDate": 1 }' SELECT device.ChannelIDs FROM OPENJSON(@JSON) WITH ( ChannelIDs NVARCHAR(MAX) '$.ChannelIDs' AS JSON ) AS device […]
SQL Azure - Administration
Stop and start an instance - Hi Colleagues, November 2022 Feature Wave for Azure SQL Managed Instance. Have you heard about it? This update brings an exciting feature. The possibility to turn off SQL-managed instances. However, it is only available for Dev/Test Subscriptions. This is good for me. I had the option available in my SQL-managed instance Azure portal not long […]
Amazon AWS and other cloud vendors
When does the AWS Free Tier ACTUALLY expire? - Hello. I keep reading that to check the expiration date for the AWS Free Tier, you need to check the first month that appears in your "Billing" section. Problem is, I signed up for AWS on the 28th of February of last year, which means I have a February 2022 bill. By that logic, January […]
Reporting Services
SSRS 2019 Intermittent Could not load folder contents Something went wrong. - A number of individual users are receiving the following error  "Could not load folder contents Something went wrong. Please try again later." A reload just a few seconds later brings up the folder contents.  This is happening multiple times a day. Ultimately the folder contents come up, but only after a reload of the browser.  […]
General
What “paths” may I have as a future Python developer? - Hello! have been lurking in this sub for a while now. Am a 30 year old who’ve told himself that I’ll study programming for years and reading within this sub have encouraged me on a path towards finally studying Python. Am more than half-way through the introductory freecodecamp course with the book from py4e side […]
SQL Server 2022 - Development
Reporting periods - trying to find the best way to automate a report only the current reporting period. Each are 8  months long and start/end on certain dates. RP 1 : 07/01/2021 to 02/28/2022 RP2: 03/01/2022 to 10/31/2022 RP3: 11/01/2022 to 06/30/2023 RP4: 07/01/2023 to 02/28/2023 The only ID's and values that should show up are 142 and […]
 

 

RSS FeedTwitter

This email has been sent to newsletter@newslettercollector.com. 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

 

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