Infrastructure at your Service

All Posts By

Stéphane Haby

Stéphane Haby

First steps on Kusto Query Language (KQL)

By | Database Administration & Monitoring, Database management, Development & Performance, SQL Server | No Comments

Do you know this query language?  No, it’s time to explain you and see what it is.   “A Kusto query is a read-only request to process data and return results.” dixit Microsoft Documentation here The KQL is very simple to understand and use. I can do it then you can also do it! 😛 The first thing to know is how to call the information on a table. In this case you  need to…

Read More
Stéphane Haby

SQL Server tips: How to migrate database-users in another domain without touching permissions

By | Database Administration & Monitoring, SQL Server | No Comments

By a customer, I must migrate a database from a domain to another. The goal is to keep the database-user permissions, take the new SID from the windows login of the new domain and change the database-user name. In my blog, I will do it with two dbi’s domains: – dbiservicech: The old domain – dbiservicecorp: The new domain I have two Windows groups dbiservicech\dbi-owner and dbiservicech\dbi-reader in my database test-dbi. I create two new…

Read More
Stéphane Haby

SQL Server 2019: Copy files through SQL Server

By | Database Administration & Monitoring | No Comments

Three new interesting extended stored procedures comes with SQL Server 2019. I was very interested to discover these new store procedures: Sys.xp_copy_file is to copy a specific files from a folder to another Syntax: exec master.sys.xp_copy_file ‘source folder+file’, ‘destination folder+file’ Example: exec master.sys.xp_copy_file ‘C:\Temp\Sources\File1.txt’, ‘C:\Temp\Destinations\File1.txt’ Before the command: After the command: As you can see in my test, you will have these 2 information where indicate the sucess of the query: Commands completed successfully. Time:…

Read More
Stéphane Haby

SQL Server Tool: MSSQL-CLI

By | Database Administration & Monitoring, Database management, SQL Server | No Comments

MSSQL-CLI is a useful new command line tool. Not so new because this tool exist since 2018 but a little bit unknow. You find this tool on GitHub here. One of the big advantage is the number of platforms available, Windows of course but also macOS, Ubuntu, Debian, CentOs, Red Hat, OpenSuse, Suse Enterprise and Fedora. This interactive command-line query tool has many advantages like the full IntelliSense support, the auto-complete, the syntax highlighting, the…

Read More
Stéphane Haby

SQL Server Tips: Path of the default trace file is null

By | Database Administration & Monitoring, Database management | No Comments

In addition of my precedent blog about this subject “SQL Server Tips: Default trace enabled but no file is active…”, I add a new case where the default path of the trace file was empty. The first step was to verify if the default trace is enabled with the command: SELECT * FROM sys.configurations WHERE name=’default trace enable’ It is enabled, then I check the current running trace with the view sys.traces SELECT * FROM…

Read More
Stéphane Haby

One day training @ Microsoft Azure Cloud Workshop

By | Big Data, Cloud, Database Administration & Monitoring, Database management, SQL Server, Technology Survey | No Comments

Today, with my colleague Christophe, we follow the Microsoft Azure Training Day: Data and Analytics @ Microsoft Zürich (Wallisellen to be exact). After a presentation of SQL Server 2019, we begin with the First Lab about SQL Server 2019 and new features and we going through intelligent query processing, Data Discovery and Classification for personally identifiable information (PII) and General Data Protection Regulation (GDPR) and secure enclave. One of my favorites part of the lab…

Read More
Stéphane Haby

SQL Server Tips: Orphan database user but not so orphan…

By | Database Administration & Monitoring, Database management | No Comments

Beginning of this year, it is good to clean up orphan users in SQL Server databases. Even if this practice must be done regularly throughout the year of course. 😉 During my cleaning day, a new case appears that I never had before and enjoy to share it with you. To find orphan database-users, I use this query: SELECT *FROM sys.database_principals a LEFT OUTER JOIN sys.server_principals b ON a.sid = b.sid WHERE b.sid IS NULL…

Read More
Stéphane Haby

SQL Server 2019: Java in SQL Server hard to believe, no?

By | Development & Performance, DevOps, SQL Server, Technology Survey | One Comment

It has already been a few months that we are testing the next version of SQL Server: SQL Server 2019. I already blogged about a previous version of SQL Server supporting R and Python. With the new version of SQL Server 2019, Java will also be integrated. The Java runtime used is Zulu Open JRE and can be tested from the CTP3.2 of SQL Server 2019 Step 1: The installation Like a lot of people,…

Read More
Stéphane Haby

SQL Server Temporal Table – How to store a history table in another file?

By | Database Administration & Monitoring, Database management, SQL Server | 2 Comments

Few days ago, a customer asks me if it is possible to move the history table to slower but cheaper storage. The question behind this is whether it is possible to create a history table on a separate filegroup and file. Few years ago, I write a serie of blogs about temporal table here. I will take the same example to try to set up a filegroup specific to a history table. In my sample,…

Read More
Stéphane Haby

SQL Pass Summit 2018: SQL Server 2019 features coming soon!

By | Database Administration & Monitoring, Database management, SQL Server, Technology Survey | No Comments

It’s the 20th anniversary of the event and the keynote today was amazing (see the blog from Christophe) for different reasons but the more important is that is every time better people. Not only DBA’s but also people using their application connected to the database. Today, one of my focus will be the next version of SQL Server 2019 with the session of Bob Ward, Asad Khan & Amit Banerjee from Microsoft. I already tested…

Read More