Showing posts from November, 2018

Load and run custom T-SQL scripts in SSMS via Snippets

If you work with SQL Server on a daily basis, it is very likely you have a lot of custom scripts you have to execute frequently, maybe you have stored them on a folder and you open them manually as you need them, or have saved them on a solution or project file, maybe you execute a custom .bat or PowerShell file to load them when you open SSMS... Every method has its pros and cons, and on this post, I will show you a new method to load your custom scripts on any open query window on SSMS via Snippets. What is a Snippet? According to Microsoft Documentation : Code snippets are small blocks of reusable code that can be inserted in a code file using a context menu command or a combination of hotkeys. They typically contain commonly-used code blocks such as try-finally or if-else blocks, but they can be used to insert entire classes or methods. In short words is custom code (T-SQL Scripts for us) that you use a lot and you want to have always available to use. In SSMS there ar

Enable Machine Learning Services on SQL Server

R Services (SQL Server 2016) or Machine Learning Services (2017 and 2019 CTP) provide you with the ability to perform data analysis from the database itself using T-SQL. You can learn a little more about what you can do in the SQL Server blog . On this post, I will show you how to setup and configure it so you can start using it right away in your applications and reports. To install it You have to choose it from instance features on your SQL server setup window, you then choose the languages you want to work (R, Python) Note: if your computer does not have access to the internet, you will have to download two packages separately and then locate them in the setup window. Continue the setup as usual and finish it. After you run the setup, please make sure that SQL Server LauchPad service is running for the instance you have installed the Machine Learning Services. I recommend you to patch the instance with the latest update available in case you encounter any i