SQL

File Recovery from a legacy SQL Server database

Someone wanted files retrieved from a legacy database export. In this case, they were Word documents and PDFs stored as hex strings in an IMAGE column. The hex strings, of course, are representations of the bytes that make up the files. Now, there is a way of recovering files from this, using a native stored procedure, but I didn’t have admin-level access to this particular database. I also couldn’t use the online conversion sites, as the data was too sensitive.

Using MySQL Linked Servers with OPENQUERY

It is possible to query a MySQL database as a linked server from Microsoft SQL Management Studio (SSMS), indirectly, using OPENQUERY. Querying a Linked Server To select all records from a database table in the linked server: SELECT * FROM OPENQUERY(LINKED_MYSQL_DB, 'SELECT * FROM databasename.databasetable') Or to find a record with a field matching some condition: SELECT * FROM OPENQUERY(LINKED_MYSQL_DB, 'SELECT * FROM databaseame.users') WHERE name LIKE '%PersonName%'; There’s one problem with the above queries: They will read the entire table through the linked servers before the rows are filtered.

Migrations Using Visual Studio SQL Server Database Project

Migrations Using Visual Studio SQL Server Database Project Setting Up the Migration Project Add a new project to the Visual Studio solution. This project will initially be empty, without assembly references or scaffold files - it appears everything is native to Visual Studio. To this we need to add the connection to the database the schema is to be imported from. There will be a menu option for ‘Import’ -> ‘Database’.

Docker Basics

A Docker container runs as a sandboxed process on a local system or a server, and consists of at least one image. An image is built from the source code of an application or service, and can be distributed, through a repository, to provide others the means of testing an existing software product with minimal setup. Containers and images can be managed through the Docker Dashboard application. As such, a Docker container will require its own configurations and script that enable it to run as intended.