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

The Costumed DBA

It's Halloween today, which is a day when children typically dress up and go looking for candy. It's supposed to be trick or treat, but I've seen relatively few tricks and lots of treats with my kids. No Halloween for me, and likely a quiet day as I get ready for travel to Seattle and try to relax at home for a few days. My kids are grown and no others come to my house out in the country.

More than a few adults will dress up in costume today. Some will come to work in an outfit, which is something I've done in the past. In my 20s, I'd wear a gorilla mask and hands, frightening more than a few people who weren't expecting a hairy hand to fall on their shoulder or hand them a report. I haven't done that in years, and I think those days are behind me.

Some people will dress up at night, going out to have fun at a party. Surrounded by others that are enjoying themselves, or competing to see how creative you can be is fun. Perhaps you dress up to take your kids out and enjoy the night with them.

Many of us do need to work today, as Halloween isn't a holiday in most organizations. We'll have various experiences at work, maybe a horrific day when we break something with the wrong click or poorly structured code. Maybe we'll do something heroic that saves the day, or at least helps someone else.

With today a costume day, I want to ask you which character, hero, icon you'd like to emulate in your daily work. Is it a computer scientist like Alan Turing? Maybe Iron Man that flies in to rescue a disaster? Maybe you're the fireman that shuts down a problem. Let us know what costume you'd like your work to wear.

Steve Jones - SSC Editor

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

Redgate University
  Featured Contents

Using OFFSET for Paging

jonfrisbee from SQLServerCentral

This article shows the basics of the OFFSET command.

Accelerating Database Recovery with SQL Server 2019

Additional Articles from Database Journal

Learn how to turn on and use newer SQL Server database recovery option called “Accelerated Database Recover”.

SQL Productivity with SQL Prompt

Additional Articles from Redgate

There is an old joke that upgrading to the latest SQL Server is wasted on some DBAs, because they will still stick mainly to what worked in SQL Server 2005. This type of DBA is becoming rare, in my experience, but there is still some truth in the idea that many of us don’t get the ‘full power’ from our SQL Server tools. We work with them as they come, ‘out of the box’, and use only a fraction of their features. The time to explore ‘new stuff’, at least as much as we’d like to, remains elusive.

From the SQL Server Central Blogs - Undercover TV Podcast – Scripting Options in SSMS

david.fowler 42596 from SQL Undercover

In this episode of the podcast, Adrian looks at the scripting options available in SSMS.

From the SQL Server Central Blogs - Improving TweetDeck with Better TweetDeck

John Morehouse from John Morehouse |

If you are at involved with the #sqlfamily, you are bound to hear about the benefits of social media platforms such as Twitter.  Twitter helps us to engage each...


  Question of the Day

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


Halloween Protection

What is Halloween Protection?

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)

Avoiding the Vector

I have an R data frame that looks like this:

> travel
  Passenger FlightDate Destination Miles Dollars
1     Steve   20180225         LHR 11789    1100
2     Steve   20180512         LHR 10989    1500
3     Steve   20180620         LHR 11789    1800
4     Steve   20180830         LHR 11789    1100
5     Steve   20181015         LHR  9678    2700
6     Steve   20181212         LHR 10520    1500
7     Steve   20180810         MSY  2427     440
8     Steve   20180225         OSL  1502     210
9     Steve   20180225         DCA  1475     310

I want to extract out the mileage for the first 6 rows to a separate data frame. I decide to run this:

> = travel[1:6,"Miles"]

However, this gives me a vector that is shown here:

[1] 11789 10989 11789 11789  9678 10520

I want these in a data frame. How should I alter the statement to get this?

1 11789
2 10989
3 11789
4 11789
5  9678
6 10520

Answer: > = travel[1:6,"Miles", drop=FALSE]

Explanation: This can be done, by using the Drop=FALSE parameter. This will Ref: Use DROP = FALSE  -

Discuss this question and answer on the forums


Featured Script

Left Padding a Bigint

Shane Clarke from SQLServerCentral

Function to pad bigint with leading 0's or other single character


More »


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
Transactional Replication - Hi, I've setup some publications and subscriptions today and use a backup to start off the process ( init from backup ). Restored a backup to server Added in new subscriber using a backup file - it creates the subscription and SQL job etc ok no errors. But I just get this ( I've setup […]
SQL Server 2016 - Administration
Newbie Q: Restore fails with "Database in use" - I'm apparently very late to the game here - I intermittently (reluctantly) end up becoming someone's DBA and used to use all the time - great community, lots of great help provided. Looks like that ship sailed a couple years back! Anybody know what happened to them? That crap site in place of it […]
How to monitor a stored procedure to capture execution times - Hi, I want to monitor a procedure, Sp_search, to capture what different parameters are passed and how much time it is taking for each run. Is there a way can trace once single stored procedure?
SQL Server 2016 - Development and T-SQL
Query Store - why is my query not in top resource consumers - Hello   I've been playing around with some of the out-of-the-box Query store reports I have no problem using the standard Query Store views against queries that have been run, amount of times, plans, executions etc. I just struggle to find the detail in the standard reports I can see details if I know the […]
Is SSIS really that bad? - Today we had our weekly team meeting. Part of my team is working on a new app to convert an ancient MS Access app into a WPF app. We're also introducing a new database for the new app. Thus we've got a need to migrate data from the old db to the new db. Because […]
SQL 2012 - General
SSMS - Results Tab - Keyboard Shortcut - Greetings, In the results tab, is there a keyboard shortcut to copy a whole column of data starting from row number xx? I currently achieve this via another method by selecting a couple of cells in a column at the appropriate row number and then highlighting them by using shift and the mouse wheel. Ideal […]
NEED HELP - Hi all I am so happy to be part of our community. Hope to be shared your tips, knowledge cos I am new Ths in advance ^^  
Update field in records w/ MIN timestamp - I have a query that selects the record with the MIN timestamp based on a several GROUP BY fields.  The query works properly and returns 30,592 records.  However, for all selected records, I want to update a Score field to a value of 1.  When I try to run an update based on my select, […]
Remove the middle of a string between wildcards - I have a field called 'jsonpayload' in a table called 'auditlog' that is populated with activity from logged on users of a website.  Part of the payload includes the permalink for the page of the site (such as /randompermalink).  The permalink can be any number of characters into the string, but always comes between "dealPermaLink:" […]
SQL Server 2012 - T-SQL
Minor code change will it make a difference. -   Please let me know your thoughts on the below. Updated a small portion of the code. Just want to make sure it will give the same result. AND EXISTS (SELECT * FROM tbTask JOIN tbX_Dim_LatestVersion X ON X.X_ID = OD_X_ID AND X.X_Id = @X_ID WHERE Origin_ID = FI_ID) IS the below code does the […]
SQL Server 2008 Administration
How to upgrade to SP3 with multiple named 2008R2 instances on same server - I have a server with two named instances of 2008 R2, SP1.  I have downloaded the upgrade executables from Microsoft to upgrade to SP3 and then do the Meltdown patch.  Do I need to run each executable twice, one for each instance? If so, how?  I tried looking for posts describing how to do this […]
Upgrade from SP1 to SP3 on server with two named instances, run upgrade twice? - I have a server with 2008 R2 SP1 using two named instances.  When I run the SP3 upgrade executable (SQLServer2008R2SP3-KB2979597-x64-ENU), do I run this once or twice (one for each instance)?  I also realize that I need to run the Meltdown Patch executable, I presume also one time or two times?  For my single instance […]
Reporting Services
Summing Value in a Group - I have a table with subtotals as well as line item details. I'm trying to get a sum of the subtotal values by each customer as shown here. I can't figure out how to write the expression to get the highlighted items. I should add that, while in this example the line items do add […]
Integration Services
Used Stored procedure in SSIS with different database name in DEV, Test and Prod - Hi, Can you please give me Idea, how can i use stored procedure in SSIS with different database name in Dev, Test and Prod ? In stored procedure, I am going to use source server as Phm_Dev ( Reading the data ) and load into  Med_Dev (destination server) So when I move my SSIS In […]
Unable to Open SSIS 2017 package - Hi,   There are a couple of SSIS package (2017) version developed by another developer that are running flawlessly from the server. As the developer moved to a new role, he saved the packages in a folder in the server . I am unable to open those packages from the server. When i asked another […]


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 This newsletter was sent to you because you signed up at
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved.


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