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

Daily Coping Tip

Share a happy memory with someone who means a lot to you.

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.

Learning Intentionally with a List

We're coming up on the middle of the year, and I wonder if you are improving your career this year? Did you make plans and are you sticking to them? I've been tracking progress on my goals, and so far mediocre progress.

It's tough to learn, but even tougher to learn when you don't have a specific focus. Choosing to "get better at T-SQL" isn't a good goal. It's vague and hard to measure. To me, you need to pick some specific areas to focus on and then develop some goals on what you want to accomplish. For example, you might want to learn to work with APPLY and convert some queries from joins to APPLY or pick a series of challenging problems that you can solve with that operator.

Mental note: make some lists of problems to solve.

These days there are so many areas that you could focus on when working with data that it can be overwhelming to try and pick something. If you were to think about what you want to learn today, what's the list of things you think you need to learn?

If you have that list, then can you choose a few specific things that will help you measure your progress? I've picked a few, but not enough to measure tightly. That's something I need to change for next year, with some ways to measure myself better.

If you are working on growing your skills, share some ideas on how to improve your career and skills. What types of things help you get better?

Steve Jones - SSC Editor

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

 
 Featured Contents

Real Time data streams from SQL Server using Kafka Connect in the Cloud

mayurj111 from SQLServerCentral

See a simple demonstration of how Kafka can stream events for changes to data in SQL Server tables.

A Quick Diff Checker for SQL Server Databases

Additional Articles from Redgate

Compare the schemas of two SQL Server databases using SQL Compare command line then quickly produce a diff report showing you immediately which tables, views and functions have changed.

Introduction to generic Power BI themes

Additional Articles from SimpleTalk

Formatting Power BI visuals can be tedious. In this article, Adam Aspin explains custom Power BI themes that will save you time when creating reports.

From the SQL Server Central Blogs - Are You a Diverse User Group or Event?

Steve Jones - SSC Editor from The Voice of the DBA

One of the things that I’ve seen crop up at various points in my career is a question of diversity. I know there are many people that don’t think...

From the SQL Server Central Blogs - EightKB Summer 2021 Edition

dbafromthecold@gmail.com from The DBA Who Came In From The Cold

The schedule for EightKB Summer 2021 Edition has been announced! Here’s the schedule: – N.B. – I particularly like that if you click on the session on the website,...

 

 Question of the Day

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

 

Debugging a PowerShell Function

I have this test function for debugging. My default value for $DebugPreference is SilentlyContinue.
function Test-Debug {
    [CmdletBinding()]
    param($a)
    Write-Debug ('$DebugPreference is ' + $DebugPreference)
    Write-Host ('Default: ' + $DebugPreference)
}
If I load this into my environment and execute it, what two values are returned for the $DebugPreference variable when I execute it like this?
Test-Debug 12 -Debug
Write-Host ('Default: ' + $DebugPreference)

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 R function scope

I have this function in R.

f <- function(i) {
   g <- function(j){
       j+k
   }
   k <- 4 
   i * g(i)
}

I then run this code:

> k <- 10
> f(4)

What is returned?

Answer: 32

Explanation: In this case, the assignment inside the function, f, takes precedence and results in the inner function, g, returning 8 (4 from k and 4 from j. This then is multiplied by the 4 passed in as variable i. Ref: R functions - http://adv-r.had.co.nz/Functions.html

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
Business Use changes - when to delete disabled jobs - Over the past 5 years with my employer, I have created a number of stored procedures, jobs, etc as I built interfaces for outside vendors. As the vendors have changed, and we entered into an affiliation agreement with a larger organization, many of the jobs are now disabled and the tables and SPs are no […]
SQL Server 2017 - Development
Seeking input on Best Method to Join on First or Last Row in a 1:M Join - I have included the DDL to re-create the 2 tables in this examples. I can't post the actual DDL so these are abbreviated versions of the 2 tables I'm working with. The relationship between PERSON and PERSON_HISTORY is 1:M.  What I seek is the most effective/best method for joining these 2 where I get only […]
SQL Server query results sort order with totals - I am trying to sort by the ID with the highest total. I can sort by ID and then get the total for each member but I cannot seem to get it to sort by id and total. Below is what I have and what I want. On what I have I am doing Any suggestions on […]
SQL Server 2016 - Administration
Argument syntax for SSIS Execute Process Task Editor - Hi, I'm trying to modify my SSIS packages to use sftp and since it cannot be done using the FTP Manager Connection within SSIS, I am calling a PowerShell script to connect to our sftp server and move the files as needed.  The PowerShell script works okay and copies the file with no errors, but […]
Handling reports of slow-running procedures - Hello experts, Does anyone know of a page or document that outlines a process for user reports of "slow-running procedures"? This issue is pretty frustrating for me because SQL activity is so dynamic that it's not like easier problems of missing permissions, low drive space, etc. Each time I get a request to look into […]
SQL Server 2016 - Development and T-SQL
Multiple deadlocks occuring on simultaneous deletions from temporal table - We have a stored procedure which is attempting to delete 1-2 rows at a time from a temporal table overnight. The stored procedure is executed several times simultaneously (around 10-15 threads) by parallel processes, and so attempts may be made to delete 30 rows simultaneously by different SPIDs, for example. DELETE FROM dbo.Table WHERE ID […]
Does Every BEGIN require an END - Does every instance of BEGIN within your code require an END? I've seen more than one piece of code, usually a Stored procedure made by the vendor who provides our accounting software, that has more instances of BEGIN than END.  I always believed that every instance of BEGIN required an END. Is that not the […]
help on execute table variable into one table - I have created table variable as below , just want to that result into table as last line is not working please help on that, Select * into table_temp from execute (@query) how to make sure this query like select * into table_2 from  table_1   DECLARE @cols AS NVARCHAR(MAX), @query AS NVARCHAR(MAX) select @cols […]
SQL Server 2019 - Administration
UniqueIdentifier as Primary Key, non-clustered index, fragmentation issue - I've been working a little bit with a few tables here, they've got "CreatedDate" as clustered Index and and Id (UniqueIdentifier) as Primary Key. The Id's are generated from code and are non-sequential. The problem(?) is that the Id-PK index gets heavily fragmented almost instantly even after a defrag-session. I can't say I've identified any […]
SQL Server 2019 - Development
DB logins permission script out - Hi, Can anyone share or point me to get -DB logins permissions in a single script. Not using use dbname. I could see all script is having use db, since i have lot of db.
Unable to connect to Remote SQL Server Application from C# Application - Hi there We have a remote SQL Server instance on a VM , that we can connect to successfully from SQL Server Management Studio on my local machine. However I am having problems connecting to this database from a c# application Now my connection string is as follows: string ConnectionString = "server=METRODEMO\\SQLEXPRESS;Database=Logger;Trusted_Connection=True;"; I have also […]
SQL Server 2008 - General
Foreign key for Xml Datatype - Is foreign key constraint possible in xml data type? OR Is it possible to mention multiple Foreign keys  in a single cell? For ex: If xml has 2 rows, 2 ids will be given in main col with some separator, if xml has 3 rows then 3 keys so on. Can it be done?
Checkdb error - While  executing DBCC CHECKDB i am getting following error "Check terminated. A failure was detected while collecting facts. Possibly tempdb". Checked for estimated tempdb following was the result. Estimated TEMPDB space needed for CHECKALLOC (KB) 19762 Estimated TEMPDB space needed for CHECKTABLES (KB) 1 Auto growth is enabled for tempdb still error repeats. what is […]
Powershell
table script to dump to csv with foreign key order - Can PS be used to dump the SQL DDL to csv but do it in the order which would used to reload an empty database.. Tables have lots of foreign key constraints .  I would like to produce a file that I could use to rebuild an empty database, but foreign keys are causing me […]
Oracle
Need Help with Pivot / Unpivot SQL - Hi Can any one help me with query to transfer from position1 to position2 as shown below ?  
 

 

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

 

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