SQL and databases

Install and run MSSQL Server in Docker

Short manual how to execute MSSQL server in Docker in Windows 11. For linux there are the same steps but instead of PowerShell you should use terminal and don’t forget about sudo. Read more»

SQL and databases

Get duplicate SQL entities and remove duplicates

We have a table with columns Id (GUID), Title (nvarchar(50)), PubDate (DateTime). After several tests there were inserted a lot of records and many of them have been inserted more than 1 time. The task is to ‘seek and destroy’ all the duplicate elements and to leave only unique rows. Read more»

SQL and databases

SQL recursive query from bottom to top

The task is to build a tree in a table with parentID from bottom to top. It’s useful for generating hierarchy strings, lists or any other types. You can also create a storage procedure of this and it will make it easy to use in queries. Read more»

SQL and databases

Common error after installation of MS SQL server 2012

After installation of MS SQL Server 2012 on Windows Server 2012, I had gotten these errors in Event Viewer on execution server:The server was unable to initialize encryption because of a problem with a security library. The security library may be missing. Verify that security.dll exists on the system.TDSSNIClient initialization failed with error 0x139f, status […] Read more»

SQL and databases

Backup MSSQL database with compression

To create a full backup of MS SQL Server database with compression use this SQL command: use YourDataBaseName go BACKUP DATABASE YourDataBaseName TO DISK = 'Z:\BACKUP_FILE_NAME.bak' WITH COMPRESSION According to database size and your server capabilities, backup time can vary.   Read more»

SQL and databases

3 ways to find out if the column in table exists

There are at least 3 ways to find out if the column in table exists in MS SQL server. It’s a common task for developers or administrators when you need to modify table. Read more»

SQL and databases

How to reset MySQL root password in Linux console (SSH)

To reset MySQL root password you should log in as root to your Linux server, stop MySQL service, start it without password and permission checks, log in as root without authorization, update password and restart MySQL server. Now more info. Read more»

SQL and databases

Get records with empty binary items

There’s a column Photo with type “Image” in MS SQL table (database – MS SQL Server 2008 R2). The task is to get all the records where Photo is empty. Values of empty images is “0x00000000”. Read more»

SQL and databases

Queries for a Sybase Administrator

While integration with Sybase server, I had to study some queries. When me and Sybase administrator couldn’t understand the reason of error, we have started to look for missed procedures or tables. So, when I had to use some queries to look for tables, view, stored procedures etc. Read more»

SQL and databases

Popular Posts