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

The 2024 Plan

Today is the last working day of 2023. Next week we start with the New Year's holiday on Monday and then many of us go back to work, starting a new year. This is the time of year where many people make New Year's Resolutions, most of which will be abandoned by March. Some of you might keep to your goals, but it is hard to make substantial changes in your life all at once, especially based on a calendar date.

Instead of making a resolution this weekend, I would suggest that you think about your career and sketch the outline of a plan. Having a plan is a good way to approach the new year, one that I think might be better than setting goals without a plan. It's easy to set goals, but without a concrete approach to attacking those goals, I think it becomes difficult to meet them, and more importantly, difficult to drive your career in the direction that makes it better for you.

I heard some good advice from Brent Ozar at SQL Saturday Boston 2023. He said a good way to build a plan is to think where you would like to be in a year. What would you like to know? Or what skill would improve your career? What do you think would impress your boss? I'm sure most of you working in technology would like to make more money or find a better employer but those are the results after becoming a better data professional, not the plan.

In a year, I think you can easily spend 50 hours working on your career, in an hour a week. Two hours a week is doable, but it can be hard to do more with a busy life, especially if you have family. However, you can make a couple of scheduled times a week to spend 15, 30, or 60 minutes on something in your career. Consider it a hobby and discuss how and when you'll find time with your partner and family. Put the times on your calendar and take the time to sit at a computer.

As for what you work on, look at my questions above, and pick a technology/language/framework/tool/platform/etc. and start typing. Write code, build a server, read what others have written, and practice answering questions that others have asked on your topic, even if you don't post the answer in a forum.

In the beginning, it will be hard. You'll feel like you aren't accomplishing anything. You might feel like you're just wasting time, but you'll learn things and slowly you will be able to actually get something done. Whether you want to train AI models, write better T-SQL, or learn to manage Availability Groups like an expert.

My last piece of advice is to write. Journal, blog, make notes, but write about what you've learned. Whether these are notes for yourself to review before an interview or published blogs that build your brand. Document your journey and I am sure you will be very proud of yourself on this date next year.

Steve Jones - SSC Editor

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

 
 Featured Contents
SQLServerCentral Article

The Profiler Extension in Azure Data Studio (ADS)

Steve Jones - SSC Editor from SQLServerCentral

This article covers the basics of the Profiler extension in Azure Data Studio, a handy way to trace your application calls.

External Article

What is OneLake in Microsoft Fabric?

Additional Articles from MSSQLTips.com

Learn about Microsoft Fabric and OneLake which is a single logical data lake for the entire Fabric platform in your organization.

Blog Post

From the SQL Server Central Blogs - Can you take a differential backup of master?

Kenneth.Fisher from SQLStudies

In one of the sessions I attended during the Pass Data Community Summit the speaker asked “If master is in ... Continue reading

Blog Post

From the SQL Server Central Blogs - Using DATETRUNC–#SQLNewBlogger

Steve Jones - SSC Editor from The Voice of the DBA

I saw someone using DATETRUNC recently in some code and realized I hadn’t really looked at this function before. It’s one that was added in SQL Server 2022, though...

Pro T-SQL 2022: Toward Speed, Scalability, and Standardization for SQL Server Developers

Site Owners from SQLServerCentral

Learn how to write and design simple and efficient T-SQL code. This is a hands-on book that teaches you how to write better T-SQL with examples and straightforward explanations.

 

 Question of the Day

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

 

The AI Puzzle

Here is a T-SQL puzzle about New Year’s Eve that Copilot created for you:
-- You have a table called PartyGuests with the following columns: 
-- GuestID int, Name varchar(50), RSVP bit, ArrivalTime time, DepartureTime time 
-- The RSVP column indicates whether the guest has confirmed their attendance (1) or not (0) 
-- The ArrivalTime and DepartureTime columns store the time when the guest arrived and left the party, respectively 
-- Write a query to find the name and arrival time of the guest who arrived last before midnight 
-- Assume that the party started at 8:00 PM and ended at 2:00 AM 
-- If there is more than one guest who arrived at the same time, return all of them 
-- If no guest arrived before midnight, return 'No guest arrived before midnight' as the name and NULL as the arrival time
Here is a table definition and some sample data:
-- Create the PartyGuests table
CREATE TABLE PartyGuests (
    GuestID int PRIMARY KEY,
    Name varchar(50) NOT NULL,
    RSVP bit NOT NULL,
    ArrivalTime time NULL,
    DepartureTime time NULL
);

-- Insert some sample data
INSERT INTO PartyGuests (GuestID, Name, RSVP, ArrivalTime, DepartureTime)
VALUES
(1, 'Alice', 1, '21:15:00', '01:30:00'),
(2, 'Bob', 0, NULL, NULL),
(3, 'Charlie', 1, '22:45:00', '00:30:00'),
(4, 'David', 1, '23:59:00', '01:00:00'),
(5, 'Eve', 1, '23:59:00', '02:00:00'),
(6, 'Frank', 1, '00:15:00', '01:45:00');
How many rows does this query return?
SELECT Name, ArrivalTime
FROM PartyGuests
WHERE ArrivalTime = (
    SELECT MAX(ArrivalTime)
    FROM PartyGuests
    WHERE ArrivalTime < '00:00:00'
)
I hope you enjoy this puzzle and have a happy new year!

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 FK Columns

I am searching in my SQL Server 2022 database for a list of columns that are used in Foreign Keys to help compile help for developers. Where do I query for the columns used in FKs?

Answer: Join sys.foreign_key_columns to sys.objects, query INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE

Explanation: Either INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE or sys.foreign_key_columns contain the columns used in FKs. 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
Arctic Wolf flooding SQL error log - Hello experts, I am not sure if anyone uses Arctic Wolf for a security tool, but we recently implemented it and one thing it does is penetration testing and vulnerability scanning on our SQL Servers. Our IT team has this turned this feature on as they want to make sure things are secure, but it […]
SQL Server 2016 - Administration
emergency!!! RecoveryPending how to fix it? - How to fix Recovery Pending State in SQL Server Database,please help
SQL Server 2016 - Development and T-SQL
Different execution plan on literals/constant VS variables - Can you please explain why am i getting different plans here? When I actually put the actual literals, I get better plan. But when I put the variable in the where clause, I'm getting table scan. Even though predicate column is an int and I'm also converting variables to an int. In my query, ididat […]
Table with 2950 columns ??? - Hi I need to import some data from a spreadsheet with 2950 columns on a regular basis Is it possible to create a table with that many columns?   Thanks  
string_agg issue - I have a string_agg line in my code that is bringing back hundreds of duplicates in my service_cd field. Any ideas? Thx!: mbr_name     codes abc                   971, 971, 971, 971.............. xyz                   978, 978, 978, 978.............. select distinct s.MBR_NAME , […]
SQL Server 2019 - Administration
2019 SSRS installation as developer edition problem - Interesting issue I ran into. I have 2019 SQL Server standard edition where I uninstalled it so that I can install as 2019 developer edition. However when I do the same for 2019 SSRS where uninstalled and then through wizard I select developer edition during installation then click next to install and after installation is […]
SQL Server 2019 - Development
Table Migration script copying over more rows than intended - All, I am attempting to perform a table migration for one table (tableA) from my source database (dbsrc) into my destination database (dbdest) based in my primary key clustered index column (tableAID), which is the identity column. I am getting my MIN tableAID into a variable (@MinID) and my MAX tableAID into a variable (@MaxID) […]
Get text from table and join with BIT column on table 2 - Ok, not sure how to explain this 100%. Here is the issue. I have 2 tables (can't post actual schema) and  I need to determine if the value in table 2 is true if the value in table 1 exists. small snippet of the table schema: table 1 id int field varchar id field 1 […]
Validation of special char and replace for the good one - Hello I need help on how to do this more efficient. I will need to write a store procedure to validate an address which contains special characters Address is like : Street : Las Ñipas 4264 So i need to remove the Ñ and replace it for N I was reading to use collate SQL_Latin1_General_CP1253_CI_AI […]
Query to get the previous row from the row selected - Hi I have payroll detail table in which I have payroll details id and an employee id (foreign key from employee table). My requirement is, when a row is selected for a particular employee, I want to get the value from a the previous row. For example if I have 3 employees and each have […]
SQL Azure - Administration
Testing a Migration from IaaS to MI, and the Log Replay Service - A bit of background - we are migrating from an Availability Group on IaaS, to a Managed Instance. The databases involved will total about 7Tb. The system is 24/7 and is a core system. The Log Replay Service (LRS) that will copy the backups from blob storage to the MI will complete when we decide […]
SQL Backups Continuing After Migrating SQL Server Off Azure - Hello, Some months back we migrated an Azure SQL server off Azure and onto a private cloud. The Azure instance was subsequently deleted from within Azure. We've noticed that daily SQL database backups and periodic SQL log backups are still occurring and are backing up to an Azure storage container and we can't work our […]
General
Python Compiler Challenge: Syntax Error Resolution - I am using Scalers Python compiler to run a script, but it's throwing a syntax error. Here's the code snippet: def calculate_sum(numbers): total = 0 for num in numbers total += num return total numbers = [1, 2, 3, 4, 5] result = calculate_sum(numbers) print(f"The sum is: {result}") Upon compilation, the compiler reports a syntax […]
Analysis Services
Help on Aggregation - Recently started SSAS. I have a Date Dimension, Day --> Month --> Quarter --> Year and a simple Sales Fact table. I want to calculate the percentage and aggregate only if the percentage is => 75% (please see image) on the DimDate Hierarchy. So below (showing Quarter to Year), the Q3 of 60% shouldn't be […]
SQLServerCentral.com Website Issues
Weird formatting issue - Just saw this one pop up, not sure if it is a "known" bug or not, but thought I'd report it as I didn't see it in this section. If I have the following code: SELECT [T1].* -- or could do [T2].*, not certain which table row you are trying to show, you may just […]
 

 

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

 

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