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

Daily Coping Tip

Take a photo of something special

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.

Better Laptop Life

I've had a lot of laptops, and I work on them regularly as I travel. I tend to be a "just use it" person and don't like to keep changing settings and optimizing things. The same for my mobile device, where I tend to leave the brightness set, location services on, and  just use it. Of course, I barely get a day of battery life.

On my laptop, I get a number of hours, though not 10. I tend to have SQL Server running (usually 2 instances) and a few other services. I do cut off wifi at times, but not that often. I know I could do more to get better battery life, but really, I am not without a power source that often, and if I do, usually I just stop working and read something instead.

It would be nice to get better life from devices, especially as nightly charging is a pain. I love that my watch lasts 4-5 days and wish my phone would do that. I ran across an article on changes that Intel is making and it seemed to imply that mobile CPU manufacturers play some tricks to extend the lifetime of devices. I guess that is good, though it doesn't seem like I am seeing multi day life from many devices.

Apparently Intel is trying to build hybrid processors that combine the power of the big processors with the power benefits of the Atom "small" processors. These should allow better lifetime of devices, if the OS can work out the scheduling between the two different types of cores. Microsoft has been doing some work here, though I don't know when we'll see actual products that work.

The dream might be a device that I can charge twice a week and get some level of usage out of it. Maybe in the future I'll keep a small mobile, a mid size tablet, and a laptop and find a way to use all three in work and only need to charge them every few days. I don't know if we'll get there, but I'm hopeful that device lifetime will improve with some technical breakthrough.

Steve Jones - SSC Editor

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

 
  Featured Contents
Stairway to Data

Stairway to Data, Level 4: Temporal Data

Joe Celko from SQLServerCentral.com

Joe Celko tackles the most difficult of all the types of data handled by SQL, temporal data, and explains how to avoid the commonest traps for the unwary programmer

Using a Public Web Service to Consume SQL Server Build Numbers

Additional Articles from SimpleTalk

Keeping SQL Server instances patched can be a time-consuming task for DBAs. In this article, Alejandro Cobar explains how he created a service in Azure that anyone can use to retrieve the build information for SQL Server.

Simple Database Development with SQL Change Automation

Additional Articles from Redgate

SQL Change Automation makes automation simple enough that it can adapt to suit many different approaches to SQL Server database development. Phil Factor describes a project to update the Pubs database, using it in combination with a PowerShell function and to maintain in source control the build scripts, migration scripts and object-level scripts, for every version of the database.

Free eBook: Defensive Database Programming

Press Release from Redgate

Resilient T-SQL code is code that is designed to last, and to be safely reused by others. The goal of defensive database programming, the goal of this book, is to help you to produce resilient T-SQL code that robustly and gracefully handles cases of unintended use, and is resilient to common changes to the database environment.

From the SQL Server Central Blogs - I created a table and SQL created a schema and a user.

Kenneth.Fisher from SQLStudies

Demo first and then I’ll explain what happened. First thing I did was run this script: CreateUsers.bat It’s a quick ... Continue reading

From the SQL Server Central Blogs - Backup On-Premise SQL Server to Azure BLOB Storage

david.fowler 42596 from SQL Undercover

SQL Server has given us the option to backup our databases directly to Azure BLOB storage for a while now but it’s not something that I’ve had all that...

 

  Question of the Day

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

 

Adding a Calculated Column in R

I have this dataframe in R:
> sales.data
   orderdate customerids orderqty orderprice orderev
1 2020-01-01           1       10         10     100
2 2020-01-02           2       20         10     200
3 2020-01-03           3       30          9     300
I want to add a column that expands out the quantity * price to check the revenue amount. I'll call this the ordertotal. How do I add this column in R?

Think you know the answer? Click here, and find out if you are right.

 

 

  Yesterday's Question of the Day (by Evgeny Garaev)

Memory-Optimized Table Truncation

There were several improvements in the SQL Server 2019 for memory-optimized tables. Does SQL Server 2019 support table truncation for memory-optimized tables?

Answer: No

Explanation: Table truncation is still not supported for MOT tables. As per Books Online: "The TRUNCATE operation is not supported for memory-optimized tables. To remove all rows from a table, delete all rows using DELETE FROMtable or drop and recreate the table." Ref: Transact-SQL Constructs Not Supported by In-Memory OLTP - https://docs.microsoft.com/en-us/sql/relational-databases/in-memory-oltp/transact-sql-constructs-not-supported-by-in-memory-oltp?view=sql-server-ver15

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
Using two different backup products for each of data and log -   To shorten a long story, my organisation has decided to have a vendor perform daily full backups using "Backup Product A" whilst the DBA will perform transaction log backups using "Backup Product B". The recommendation to use 1 system overall was overruled. In the event a restore is required it will be the DBA's […]
SQL Server 2017 - Development
Update table and then executeJob in loop - I need to write a query which will first update the table, then execute the job and if the job is successful, again update statement. This would be a loop. this is how it looks DECLARE @dttm datetime DEClare @datetable table (dttm datetime) insert into @datetable values ('2017-01-01 00:00:00.000'), ('2018-01-01 00:00:00.000'), ('2019-01-01 00:00:00.000') DECLAre Upddate […]
Adding NOT NULL to column with existing rows causes page bloat - Hi, I'd like to know why the page count is almost exactly doubled for a table with existing rows, having updated the column in question with values so none are NULL (this step also causes double pages, but I understand why, fragmentation becomes 99% so i REBUILD clustered index), then running ALTER TABLE ... ALTER […]
SQL Server 2016 - Administration
How to change the Scan to Seek and optimize - Hello, Attached sample query and actual plan, I want to further optimize the query and change the scan to seek? Do I have to create an IDX or modify the query in this case?  Please let me know thoughts  
Compare sql-2012 and sql-2016 settings - Hi everyone, W are just doing a migration from sql 2012 enterprise  to sql 2016 standard. This involves migrating lots of sql jobs running on sql 2012. I would like to make sure that performance doesn't degrades after we migrate. I would like to check and compare all configurations ( Sever  as well as DB […]
is Clustered Columnstore index UNIQUE by default? - Or should I explicitly specify 'CREATE UNIQUE CLUSTERED COLUMNSTORE INDEX....' ? If I don't specify UNIQUE,  can a clustered index actually be non-unique..??
Failover Cluster Instance Share - Hi, I am using AlwaysOn Availability Groups in SQL Server 2016 with a primary and secondary replica. I have a Quorum file share witness on a separate file server. This file server needs to be rebooted, so I'm wondering what I need to consider before rebooting this box... Anyone have experience with this? Also, I […]
SQL Server 2019 - Administration
Limitation on a file size import - Is there a restriction of file size that can be imported into SQL? 5 gig, 10 gig???
Pintable into cache - Pintable into cache to avoid fragmentation I have a table(OLTP database) which gets fragmented every day and it goes through the defragmentation process every week.Which means I am doing the same process over and again every week. Can I pin such tables in the memory permanently or for a specific period of time and write […]
SQL Server Newbies
stored procedure to delete user and login - I was trying these but it does not work: USE [MyDatabase] GO /****** Object: StoredProcedure [dbo].[sp_deletelogin] Script Date: 4.7.2020 3:29:23 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER proc [dbo].[sp_deletelogin] @szLogin varchar(50),@defaultdb varchar(50) as if not exists ( select 0 from sys.sql_logins where name = @szlogin) begin EXECUTE AS LOGIN='sa'; exec ('delete login […]
Reporting Services
Upgrade SSRS server but not DB engine? - I need to upgrade the SSRS report server so that it is compatible with Chrome/Edge. However the database server where the SSRS DBs live is not at a stage where I can upgrade it yet as there are 3rd party vendor DBs that need to be investigated. Is this possible? The report and DB servers […]
General
Beginner needing help - Removing post
Integration Services
Connecting To Quickbooks via SSIS - Hello everyone, Been doing some googling trying to find some info on connecting to Quickbooks desktop from SSIS.  Everything I'm getting back is third party options where I have to pay.  Trying to avoid that if I can.  Seems like some sort of ODBC driver or something should be available for this where I can […]
COVID-19 Pandemic
Daily Coping 6 Jun 2020 - Today’s tip is to think of something you’ve always wanted to do and never tried. http://voiceofthedba.com/2020/07/06/daily-coping-6-jul-2020/
Daily Coping 3 Jul 2020 - Today’s tip is to thank a friend for the joy they bring into your life. http://voiceofthedba.com/2020/07/03/daily-coping-3-jul-2020/
 

 

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

 

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