Q&A archive

Stack Exchange Answers

Questions and answers Andy Mallon contributed across the Stack Exchange network.

DBA Stack Exchange

SQL Server replication additional subscriber

Question I have a publisher with the distributor on the same server which is transactional replication. There is also an active subscriber using push method. I need to set a new subscriber up going to a different server using the same articles as the current …

Read answer

DBA Stack Exchange

Always backup database with encryption

Question Is there a way to force all database and log backups run on the server to be encrypted? If encryption is not specified, the query will be terminated. Asked2021-09-12byAvi Answer Not in SQL Server There is no option to force BACKUP DATABASE & BACKUP …

Read answer

DBA Stack Exchange

Partitioning and existing Indexes

Question I have a table that consumes almost 1.2 TB of space and has lots of historical data which are mostly irrelevant. Since performing bulk DELETE is going to cause a lot of heavy-lifting, I'm trying to use the concept of horizontal partitioning to create …

Read answer

DBA Stack Exchange

Identify how many CPUs our database server is using

Question Our server where the Microsoft SQL Server 2016 Web Edition server is installed is running very slow. We are thinking of increasing the number of cores licensed on it. However, we need to check how many CPU cores the database is using currently. Our …

Read answer

DBA Stack Exchange

insert on table being unnaturally slow

Question I have an "Basic" pricing tier Azure SQL database with a table of 7 columns, an ID column of int that is the clustered index and primary key, one datetime2(0) column, 3 varchar(100) columns and 2 varchar(MAX) columns, all nullable.

Read answer

DBA Stack Exchange

What are the .BCP files inside a .bacpak file?

Question Diving on dba.stackexchange.com I found a nice answer that teach me how to open a .bacpac file with File Explorer. I gave it a try with the database AdventureWorks2008R2 and all I did was: Save the database as .bacpac file Rename the file extension …

Read answer

DBA Stack Exchange

Job to stop other job at specific time

Question We have a job which imports data daily from a remote SQL Server every night, I'll call it Import-Job. Most of the time this job runs through in about 15 minutes and everything is fine but due to a rather unstable VPN connection sometimes the job …

Read answer

DBA Stack Exchange

Getting the first Monday after the third Friday

Question I have seen on this site how to get the the third Friday of the month: select quote_date FROM table where datename(weekday, quote_date) = 'Friday' and datepart(day, quote_date)>=15 and datepart(day, quote_date)<=21; How would I get the first Monday …

Read answer