We have a fair number of pretty large databases, and I was having a hard time scheduling full integrity checks to run at least once a week. For a long time, I only ran physical_only with my fingers crossed, but finally, I got a new…
This came up because a user had db_owner perms and it was only reading from a database and creating a table variable from it. I created a new user (on a test system) with read only permissions to test if the code would still work.…
I wanted to find out what data types SQL Server auditing was using, so I put the auditing file results into a temp table and executed tempdb..sp_help on that temp table to get the schema. This will give you the following results: Here’s the expanded…
This is a super simple way to retain the data and settings that you create and change on your SQL Server Docker instance. There’s a lot of talk about attaching databases after you recreate your Docker container, but I found that you just have to…
There are three ways to get into bash in a docker container: docker exec -it containername bash docker exec -it containername “bash” docker exec -it containername /bin/bash Once you run those from the command line, it brings you to the top level of the file…
I want the ability to search through all the SQL Server logs without having to know how many log files there are, so I created this script to do that:
Run psql in docker exec docker exec -ti NAME_OF_CONTAINER psql -U YOUR_POSTGRES_USERNAME
This requires a different image in Docker. You can’t just use the postgres image and create an extension in it. Instead, you have to use the postgis image. This image will have a database in it already setup for you to use with postgis. If…
This is a super simple way to retain the data and settings that you create and change on your PostgreSQL Docker instance. There’s a lot of talk about attaching databases after you recreate your Docker container, but I found that it’s easier to have persistent…