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”
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. :-)
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. :-)