Sunday 20 September 2020

DocumentDB Data Migration Tool Error: The remote server returned an error: (400) Bad Request

 Hey everyone, welcome back to SQL SOMETHING!!!

Today, we are taking a look at migrating Azure Cosmos DB data to a JSON file that will be stored in Azure Blob Storage. This will be using the Microsoft DocumentDB Data Migration Tool. Our focus is also more on the following error that  may occur when trying to write to an Azure Blob Storage Account:


The remote server returned an error: (400) Bad Request

 


Let's take a look at the solution.

Tuesday 14 July 2020

Mini Post: Listing ALL Databases On A Server

Heyyyy everyone, Geon still here. I hope everyone has been well during these times and keeping safe. Remember to wash your hands and wear your mask!

Now, I realized I made a few listing queries over the years: how to list all stored procedures, how to list all tables with a given name, how to list all connections... but I just realized I never did the simplest of them all:

How to list all databases on a server.

To do this, we can query the sys.databases system table. This table can provide us with a wealth of database knowledge such as:

  • Database Name
  • Database ID
  • Creation Date
  • State
  • Collation


You can filter on any of these fields as you would a regular query.

Please see below for a simple example query I've had to use recently:

SELECT 
s.name as DatabaseName,
s.database_id as DatabaseID,
s.create_date as CreationDate,
s.collation_name as Collation,
s.recovery_model as RecoveryModel,
s.state_desc
FROM 
sys.databases s
WHERE
create_date >= '01/01/2020'
ORDER BY name;

I hope this was useful to someone. :-)


DISCLAIMER: As stated, I’m not an expert so please, PLEASE feel free to politely correct or comment as you see fit. Your feedback is always welcomed. :-)


Sunday 31 May 2020

Power Apps And Staying At Home

*knock knock*

Hey everyone, I am still here and today we have another SQL Something!

First though, I would like to take the opportunity to just use this space to acknowledge the happenings in the world around us, so please, bear with me. 

2020 has been a rough year so far especially with regard to the coranavirus pandemic and the escalating tensions that are currently happening in the United States of America. I do believe we can, and will, come through this but we all must do what we can to push the process along.

That being said, this post is related in part to how we are currently living and how we can use the tools available to help ourselves and others.

So here's a video! Of your's truly! With a shaky cam! And not looking my best!



And here's a blog post in a blog post about my thought process: 

While NOT entirely (or mostly) SQL related, it does touch on application creation and the backend involved, so I guess it counts...?

Regardless, maybe it will inspire someone out there TO use their hard won SQL knowledge for the betterment of their team, community or country. Or world!

Be safe out there. Be good. And be good to others.

DISCLAIMER: As stated, I’m not an expert so please, PLEASE feel free to politely correct or comment as you see fit. Your feedback is always welcomed. :-)