Scripts

Technical Article

Migrate and Upgrade SQL Instance (2014/2016) to 2019 version with 1 click

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 […]

You rated this post out of 5. Change rating

2020-05-22 (first published: )

2,091 reads

Technical Article

Migrate and Upgrade SQL Instance (2014/2016) to 2019 version with 1 click

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 […]

You rated this post out of 5. Change rating

2020-05-22 (first published: )

1,043 reads

Technical Article

Powershell Script - Azure cosmos DB(SQL API)

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.

You rated this post out of 5. Change rating

2020-05-11 (first published: )

3,531 reads

Technical Article

Daily Sql Server Health Check

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 […]

You rated this post out of 5. Change rating

2020-05-06

11,135 reads

Technical Article

Output multiple datasets from one INVOKE-SQLCMD command

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 […]

You rated this post out of 5. Change rating

2020-04-24 (first published: )

6,167 reads

Technical Article

Unused Indexes

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 […]

You rated this post out of 5. Change rating

2020-04-21 (first published: )

3,687 reads

Technical Article

Missing index script

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 […]

You rated this post out of 5. Change rating

2020-04-20 (first published: )

7,865 reads

Technical Article

Calculating Easter in SQL

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 […]

You rated this post out of 5. Change rating

2020-04-06 (first published: )

4,083 reads

Technical Article

Select Group Members from Logins

Know who all the individual group members are for a given WINDOWS_GROUP login. This script uses the sys.xp_logininfo procedure to find group members for each login on an instance. This is useful when attempting to remove orphaned WINDOWS_LOGINS. May have issues working across your logged in domain.

1 (1)

You rated this post out of 5. Change rating

2020-03-23 (first published: )

1,405 reads

Blogs

Going to Cloud? Look at the Shared Responsibility Model

By

The bottom line here is this: the idea that a CSP takes care of...

How Long Will It Take to Learn SQL? The Truth Might Surprise You

By

In today's data-driven world, SQL (Structured Query Language) is a blazing-hot skill. It's your...

Flying Halfway Around the World to Australia

By

I leave tonight for Australia. I was in London 3 days ago, so this...

Read the latest Blogs

Forums

Fine-tune SQL for better performance

By don075

I have been asked to fine-tune the following SQL that was written by a...

Row-level security in SQL server

By dzukik0711

In this scenario, I seek assistance in implementing row-level permissions for a table named...

SSIS Web Service task SSL errors

By smithloo

I've tried different credentials, target server versions, etc. hitting our Primavera WSDL. Works great...

Visit the forum

Question of the Day

Initial Config of tempdb

What are the initial config sizes for the tempdb primary data files, secondary data files, and log files in SQL Server 2022?

See possible answers