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

How Much Linux Do You Need?

SQL Server on Linux was released with version 2017. Since then, I've seen some deployments of SQL Server on Linux, but many of the customers I work with still deploy SQL Server on Windows. While there are limitations and unsupported features, most of what we need is available in SQL Server on Linux.

I assume most of you out there work on Windows machines against Windows servers. Maybe some of you run containers, but that's likely a minority. Windows seems to have won the desktop and for most of us running SQL Server, the server room as well.

However, if you use containers, you likely use Linux ones since SQL Server isn't supported on Windows containers. I know I do, and I like them, but overall, I find I need to know very little Linux to do my job, or even work with the containers.

I like Linux. As someone who learned Unix early on and installed Linux 0.8, I thought at one point I'd spend most of my career in that world. Especially as I worked with DOS and Windows 3.1 in corporate work and found them much less capable. I still remember writing grep.bat and awk.bat files to duplicate some of the things I did in Unix on DOS machines.

For doing database work, most platforms are ported to Windows, but even if you connect to an Oracle/PostgreSQL/MySQL/MongoDB/etc. system running on Linux, do you need much linux? I find that ls, pwd, and cat get me through most of the things I need to do. When there's something more complex, like sudo systemctl restart mssql-server, there are plenty of code snippets in the docs or some website. These days, you could even ask an AI how to do many simple tasks.

If you don't use Linux, then you don't need any, but if you deal with any sort of system running on Linux, how much is important to know? What's your top ten list of things a newbie should learn? Let us know today.

Steve Jones - SSC Editor

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

 
  Featured Contents
SQLServerCentral Article

Implementing Vector Datatype with Azure SQL Server

utsav from SQLServerCentral

This article shows how to insert data into a database, create embeddings, and then use this data to search the data with a natural language interface.

Technical Article

Fun with PowerShell Asynchronous

Additional Articles from SQLServerCentral

Imagine a candle that is lit and takes 1 hour to burn out. Now imagine one hundred candles. How many hours will it last? That depends. If they are lit simultaneously, it will take 1 hour. That is the basic idea of running in the background or asynchronously. Of course, the 100 candles can execute independently of one another, unlike if you try to run 100 processes on a computer with 2 cores. PowerShell has some ways to manage that, as PowerShell job – which we will see in this article – runspaces – needs to add programmable using .net.

Blog Post

From the SQL Server Central Blogs - How to Learn SQL Without Quitting Your Day Job

Tracy McKibben from RealSQLGuy - Helping You To Become A SQL Hero

Juggling meetings, deadlines, and family? Yeah, learning SQL might seem like climbing Mount Everest in flip-flops. But guess what? You absolutely can become an SQL whiz without sacrificing your...

Blog Post

From the SQL Server Central Blogs - How-To Convert Excel Date & Time to SQL

DataOnWheels from DataOnWheels

Hey data friends! This one comes from my personal vault (aka backlog of drafts I’ve been needing to write up) and is a really simple code that I always...

Learn Microsoft Fabric: A practical guide to performing data analytics in the era of artificial intelligence

Site Owners from SQLServerCentral

A step-by-step guide to harness the power of Microsoft Fabric in developing data analytics solutions for various use cases

 

  Question of the Day

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

 

Precision and Scale II

What is the precision, scale, and length for an int variable?

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)

The Rank Window

I have this table and data:

CREATE TABLE [dbo].[SalesTracking] ( [SalesDate] [datetime] NULL, [SalesPersonID] [int] NULL, [CustomerID] [int] NOT NULL, [PONumber] [varchar] (80) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [paid] [bit] NULL ) ON [PRIMARY] GO CREATE CLUSTERED INDEX [SalesTrackingCDX] ON [dbo].[SalesTracking] ([SalesDate]) ON [PRIMARY] GO INSERT dbo.SalesTracking (SalesDate, SalesPersonID, CustomerID, PONumber, paid, total) VALUES ('2024-03-15 10:45:55.067', 1, 1,'PO965' ,1, 100), ('2023-09-24 10:45:55.067', 1, 2,'PO627' ,1, 200), ('2022-07-02 10:45:55.067', 1, 3,'PO6' ,1, 300), ('2022-11-03 10:45:55.067', 1, 4,'PO283' ,1, 400), ('2022-11-26 10:45:55.067', 1, 5,'PO735' ,1, 500), ('2023-04-28 10:45:55.067', 1, 6,'PO407' ,1, 600), ('2022-09-09 10:45:55.067', 1, 7,'PO484' ,1, 700), ('2024-03-13 10:45:55.067', 1, 8,'PO344' ,1, 700), ('2024-04-24 10:45:55.067', 1, 9,'PO254' ,1, 800), ('2022-06-19 10:45:55.067', 1, 10,'PO344',1, 800) GO

When I run this query, how many unique values are returned for the SaleRank column?

SELECT st.SalesDate , st.SalesPersonID , st.total , RANK () OVER (PARTITION BY st.SalesPersonID ORDER BY st.total desc) AS SaleRank FROM dbo.SalesTracking AS st; 

Answer: 8

Explanation: There are 8 unique values: 1, 3, 5, 6, 7, 8, 9, 10. The RANK puts the same ordinal for tied values and then skips the appropriate number. Since there are 2 1s, 2 is skipped and the next value is 3. Ref: RANK - https://learn.microsoft.com/en-us/sql/t-sql/functions/rank-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 2017 - Development
Execution Timeout Expired Error while executing an SQL query - Following error comes while executing an SQL query. Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. This happens after 30 seconds, even though I have set the Command Timeout property to 300 seconds. Here’s what I’ve already verified: The connection is working fine. I've […]
SQL Server 2019 - Development
IF then Else statement not exiting - I have an always on availability group of 3 servers (1 primary and 1 secondary (both on primary site) and the other secondary on DR site, as the only read-only secondary). A scheduled job runs every day that should only execute the tsql if the server is the primary derived from the 'sys.dm_hadr_availability_replica_states',  here's my […]
SQL Azure - Administration
Replication from SQL Managed Instance to RDS - Is transactional replication from SQL MI to RDS SQL server supported. There isn't any documentation available from Microsoft. There are a few articles about replicating from Onprem SQL server to RDS or Azure SQL DB to RDS, I couldn't find anything for SQL Managed Instance. If not replication, are there any other options available for […]
Microsoft's comparison to Azure DB vs Managed Instance - I'm migrating to the cloud from SQL Server 2016 to the cloud. On the list of differences between Azure DB and a Managed Instance, there are several features listed, such as DBCC, and DML Triggers where they say that Azure DB has "Yes, most". How can anyone find this as an acceptable answer. Any idea […]
Storage Cost - What will be the storage cost 1 Managed Disk – S15; 256 GB HDD in Azure for DISK it costs around $11.33 per month in addition to that I want to know exact cost for 100IOPs for S15. Also it would be great one can share cost for E15 too.    
General Cloud Computing Questions
what is the difference between these two queries - Please I am struggling to understand the difference between these two queries. It behaves differently as output google bigquery query 1 UPDATE dde-demo-d001.sap_crm.document_flow_root_bods SET case_guid = ICT.case_guid FROM dde-demo-d001.sap_crm.document_flow_root_bods DFR INNER JOIN dde-demo-d001.sap_crm.inferred_case_transactions ICT ON DFR.transaction_header_guid = ICT.transaction_header_guid WHERE DFR.case_guid IS NULL; query 2 UPDATE dde-demo-d001.sap_crm.document_flow_root_bods DFR SET case_guid = ICT.case_guid FROM (SELECT transaction_header_guid,case_guid FROM […]
Text search emails and other json items - Problably SQL Server is not the best solution What would you use for searching lots of emails / jsons on specific terms? We're trying to provide a solution to business to allow to search if a specific mail is sent Like subject contains X sent around interval. Body contains Y
Integration Services
"External table is not in the expected format" - Good Afternoon. I have been manually running an SSIS package on an adhoc basis, which populates an Excel file from a SQL Server Table. There is no apparent issue with the package, but often I get the following error: "External table is not in the expected format" And it resolves when I Shut Down and […]
Backups
Hyper-V VM / Google Drive syncing issue - Hi everyone, I have a server running **Windows Server 2022**, named **"DATA SERVER"**. This server has two drives: **C and D**. What I Did: 1. **Enabled Hyper-V** and created a virtual machine (VM) called **"DATA VM"**. 2. Used **Disk2VHD.exe** to create **VHDX files** of the host machine's **C and D drives** and attached them to […]
SQL Server 2022 - Administration
Error when running sql server backup routine job - Guys, I am facing problems when running a backup routine JOB in SQL Server, when trying to run the JOB, it returns an error. When checking the JOB history, this message appears: Executed as user: NT Service\SQLSERVERAGENT. Microsoft (R) SQL Server Execute Package Utility Version 15.0.2000.5 for 64-bit Copyright (C) 2019 Microsoft. All rights reserved. […]
error when trying to change replication settings - We have three servers that use SQL replication; PROD, BI, and PARTS. We have one database that replicates from PARTS to PROD and we have a around five databases that replication from BI to various Azure servers. We used to have a database called IRES that replicated from PROD to Azure - but we deleted […]
SQL Server 2022 - Development
Solution to a problem without using a CURSOR - Hi there to all SQL gurus So, here is the scenario. I have a #temp table in one of my SQL stored procedures which has only 2 columns, say Customer ID and Profile ID, and it has the below data Customer ID          Profile ID 100001              […]
Prepare Sum of Bill Amount Having two different status with fast performance - 1, Customer table [TBLMEMBER] 's structure CREATE TABLE [dbo].[TBLMEMBER]( [TRANNO] [int] IDENTITY(1,1) NOT NULL, [PARENTID] [nvarchar](10) NULL, [ACID] [nvarchar](10) NULL, [MEMBERID] [nvarchar](10) NOT NULL, [MEMNAME] [nvarchar](70) NULL, [PRINTNAME] [nvarchar](50) NULL, [GENDER] [nchar](10) NULL, [ADDRESS] [varchar](30) NULL, [DOB] [varchar](20) NULL, [PROV] [int] NULL, [GROUP] [nchar](2) NULL, [USERID] [nvarchar](15) NULL, [DISTRICT] [int] NULL, [PWD] [nvarchar](100) NOT NULL, […]
sql server not responding - SQL server became slow before I ran exec sp_updatestats
what happens to ssis and ssrs whenb we migrate to sql saas - Hi we know (or believe)  ssas saas gets stood up separately when a company migrates to sql saas. But what happens to ssis and ssrs?  from what i remember there is no such thing as ssis in azure.   And the recommendation on sssrs is to move all those objects to pbi as paginated reports.  we […]
 

 

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

 

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