SQL Server Database engine patching
This script can install Service pack, security patch and Cumulative update on SQL instance(Database Engine).
2020-05-26 (first published: 2020-05-19)
1,707 reads
This script can install Service pack, security patch and Cumulative update on SQL instance(Database Engine).
2020-05-26 (first published: 2020-05-19)
1,707 reads
This script can be used to generate Dashboard report for Always-on AG databases. Script can be placed in SQL Agent to generate report.
2020-05-22 (first published: 2020-05-12)
2,815 reads
The script includes these steps: STEP 1: CREATE EMPTY Databases STEP 2 - CREATE Logins WITH SERVER ROLES\PERMISSIONS STEP 3 - COPY LINKED SERVERS STEP 4 - COPY SERVER OPTIONS STEP 5 - COPY CREDENTIALS STEP 6 - COPY AGENT JOBS STEP 7 - COPY DB Mail STEP 8 - COPY CERTIFICATES STEP 9 […]
2020-05-22 (first published: 2020-05-12)
2,292 reads
The script includes these steps: STEP 1: CREATE EMPTY Databases STEP 2 - CREATE Logins WITH SERVER ROLESPERMISSIONS STEP 3 - COPY LINKED SERVERS STEP 4 - COPY SERVER OPTIONS STEP 5 - COPY CREDENTIALS STEP 6 - COPY AGENT JOBS STEP 7 - COPY DB Mail STEP 8 - COPY CERTIFICATES STEP 9 […]
2020-05-22 (first published: 2020-05-13)
1,089 reads
Scripts contains 4 following functions. Users can create 3 different script from this for inserting, fetching and deleting a document.
1. Function Generate-MasterKeyAuthorizationSignature - This function is used to create connection to Azure cosmos DB. This function codes were taken from Technet.
2. Function Post-CosmosDb - Insert single document in azure cosmos DB. Same function can be used to perform bulkinsert. This function code was taken from following article. To make it useful i made some modification in it.
(https://www.systemcenterautomation.com/2018/06/cosmos-db-rest-api-powershell/)
3. Function Get-CosmosDocument - Fetch single document from azure cosmos DB. Same function can be used to fetch all documents from Cosmos DB.
4. Function Delete-CosmosDbDocument - Delete single document from cosmos DB. Same function can be used to delete more than one document with some additional codes.
To use any of the function like Post,Get, Delete. you have to comment the other 2 function call. If you are using all 3 functions(Post,Get, Delete), Be cautious while using them.
2020-05-11 (first published: 2020-04-30)
3,666 reads
Are you a Senior Sql Server DBA or novice looking for a Daily Sql Server Health Check? As a Senior DBA for over 15 years I have compile a few scripts I use on a daily basis to check the health of my Sql Servers. Perform a Daily Sql Server Health Check on your Sql […]
2020-05-06
13,353 reads
A common question that I've seen online is how do I return multiple sql datasets from a single query using INVOKE-SQLCMD. Most of the answers out there say it is not possible, but it is in fact possible by using the OutputAs dataset parameter. This parameter outputs a dataset that has all of the information […]
2020-04-24 (first published: 2020-04-16)
6,807 reads
This script will provide a list of indexes that are not used in a database. Indexes are overhead and any indexes not being used but are being updated cause additional load on a database. This looks at the following items: User seeks, scans and lookups. If all three of these are zero and the User […]
2020-04-21 (first published: 2020-04-13)
3,934 reads
This script on missing indexes that SQL had found. SQL will track queries and provide suggestions on indexes it feels will provide improvements. You should not take this information and create all the indexes. Performance tuning can be an art and takes practice. This information should be reviewed and as a DBA implemented a little […]
2020-04-20 (first published: 2020-04-13)
9,434 reads
Several months ago someone commented on a calendar thread that you should not even try to calculate Easter in SQL Server because the math was too hard. That got me to thinking and I decided to see if that was actually the case. I found that there are several well known algorithms available - but […]
2020-04-06 (first published: 2020-03-31)
4,385 reads
I’m hosting a free webinar at MSSQLTips.com at the 19th of December 2024, 6PM...
By Steve Jones
I looked at row_number() in a previous post. Now I want to build on...
Recently I received a cry for help over Teams. The issue was that an...
Comments posted to this topic are about the item A Guide to SQL Security...
Comments posted to this topic are about the item I Need a CS Degree....
Comments posted to this topic are about the item Incremental Statistics
I have run this on SQL Server 2022 for the Sales database:
ALTER DATABASE Sales SET AUTO_CREATE_STATISTICS ON (INCREMENTAL = ON)I then run this in the Sales database:
USE Sales GO CREATE STATISTICS CustomerStats1 ON dbo.Customer (CustomerKey, EmailAddress) WITH INCREMENTAL = OFFThe dbo.Customer table is partitioned. How are statistics created? See possible answers