How to Restore AdventureWorks to SQL Server Express

Once you have SQL Server Express installed on your local machine, you may want to load some example data so that you can play around with it. After all, what’s good with the database without data!

MySQL comes with the Sakila database upon installation. SQL Server’s equivalent would be AdventureWorks sample database. It doesn’t come with the default installation, but you can download the back up file and restore it.

For SQL Server 2017 Express, you should download the OLAP version of AdventureWorks2017.bak. At the bottom of the download link, it has a section called Restore backup. It explains how to restore the database from the backup file with SQL Server Management Studio.

When I first tried it from the management studio’s restore database option, nothing happened after selecting the right backup file. No error message. It looked like it worked, but no database got created.

So, I ran restore database statement to see what happens and finally got the error message: Operating System error 5 (Access is Denied) when the server was trying to access the backup file.

restore database AdventureWorks from disk = 'C:\tmp\AdventureWorks2017.bak';

Operating System error 5 (Access is Denied) is caused by the server not having right access privilege to the backup file. This is because the current SQL Server user does not have the access rights to the file. To fix this issue, you need to log on as the user with the right access to the backup file (yourself, admin and so on).

Once log on as the admin user, I was able to restore the database from the management studio UI.

Yay!

Git
How to specify which Node version to use in Github Actions

When you want to specify which Node version to use in your Github Actions, you can use actions/setup-node@v2. The alternative way is to use a node container. When you try to use a publicly available node container like runs-on: node:alpine-xx, the pipeline gets stuck in a queue. runs-on is not …

AWS
Using semantic-release with AWS CodePipeline and CodeBuild

Here is the usual pattern of getting the source from a git repository in AWS CodePipeline. In the pipeline, we use AWS CodeStart to connect to a repo and get the source. Then, we pass it to the other stages, like deploy or publish. For some unknown reasons, CodePipeline downloads …

DBA
mysqldump Error: Unknown table ‘COLUMN_STATISTICS’ in information_schema (1109)

mysqldump 8 enabled a new flag called columm-statistics by default. When you have MySQL client above 8 and try to run mysqldump on older MySQL versions, you will get the error below. mysqldump: Couldn’t execute ‘SELECT COLUMN_NAME, JSON_EXTRACT(HISTOGRAM ‘$”number-of-buckets-specified”‘) FROM information_schema.COLUMN_STATISTICS WHERE SCHEMA_NAME = ‘myschema’ AND TABLE_NAME = ‘craue_config_setting’;’: Unknown …