<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>SQL Server on Data Artisans</title><link>https://dataartisans.tech/tags/sql-server/</link><description>Recent content in SQL Server on Data Artisans</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sun, 14 Jan 2024 00:00:00 +0000</lastBuildDate><atom:link href="https://dataartisans.tech/tags/sql-server/index.xml" rel="self" type="application/rss+xml"/><item><title>Python &amp; SQL Server: Manage Database Transactions</title><link>https://dataartisans.tech/python-sql-server-manage-database-transactions/</link><pubDate>Sun, 14 Jan 2024 00:00:00 +0000</pubDate><guid>https://dataartisans.tech/python-sql-server-manage-database-transactions/</guid><description>&lt;h2 id="intro"&gt;Intro&lt;/h2&gt;
&lt;p&gt;In our &lt;a href="https://dataartisans.tech/python-sql-server-bulk-loading-data/"&gt;last post&lt;/a&gt; we used &lt;a href="https://www.sqlalchemy.org/"&gt;SQLAlchemy&lt;/a&gt; to bulk load data into SQL Server. Now that we can bulk load data we want to perform other actions on our database. In todays post we want follow a common loading strategy and &lt;a href="https://learn.microsoft.com/en-us/sql/t-sql/statements/truncate-table-transact-sql?view=sql-server-ver16"&gt;TRUNCATE&lt;/a&gt; the target table before loading it. Adding this functionality to our script leaves us with a choice to make in how we want to execute our SQL statements and manage database transactions.&lt;/p&gt;</description></item><item><title>Python &amp; SQL Server: Bulk Loading Data</title><link>https://dataartisans.tech/python-sql-server-bulk-loading-data/</link><pubDate>Sun, 19 Nov 2023 00:00:00 +0000</pubDate><guid>https://dataartisans.tech/python-sql-server-bulk-loading-data/</guid><description>&lt;h2 id="intro"&gt;Intro&lt;/h2&gt;
&lt;p&gt;You have a bunch of data and need to load it into SQL Server using Python. With the abundance of options out there its difficult to know what the best tool is to use. Lets approach the problem with two requirements. The solution needs to be &lt;strong&gt;easy to implement&lt;/strong&gt; and &lt;strong&gt;blazing fast&lt;/strong&gt;.&lt;/p&gt;
&lt;h2 id="tooling"&gt;Tooling&lt;/h2&gt;
&lt;p&gt;Initially &lt;a href="https://pypi.org/project/bcpandas/"&gt;bcpandas&lt;/a&gt; looked like a great solution for this task. While it does fit our two requirements, it becomes very difficult to work with for data that contains multiple separators or any odd strings. If the data you work with is like mine it is almost never perfect. I quickly pivoted away from this due to its inability to handle imperfect data.&lt;/p&gt;</description></item><item><title>Log Shipping Restore With dbatools</title><link>https://dataartisans.tech/log-shipping-restore-with-dbatools/</link><pubDate>Tue, 17 May 2022 00:00:00 +0000</pubDate><guid>https://dataartisans.tech/log-shipping-restore-with-dbatools/</guid><description>&lt;p&gt;&lt;strong&gt;Intro&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In some scenarios a vendor or other 3rd party will send you a copy of their &lt;a href="https://docs.microsoft.com/en-us/sql/database-engine/log-shipping/about-log-shipping-sql-server"&gt;log shipping&lt;/a&gt; backups so you can keep a reporting copy of their database. Today&amp;rsquo;s post will cover how we can use &lt;a href="https://dbatools.io/"&gt;dbatools&lt;/a&gt; to automate the restore process. This post assumes you have already restored the initial full backup and are now at the point where you are ready to automate the transaction log backups you are receiving.&lt;/p&gt;</description></item><item><title>How to Configure SQL Server Management Studio for Efficiency</title><link>https://dataartisans.tech/how-to-configure-sql-server-management-studio-for-efficiency/</link><pubDate>Mon, 13 Apr 2020 00:00:00 +0000</pubDate><guid>https://dataartisans.tech/how-to-configure-sql-server-management-studio-for-efficiency/</guid><description>&lt;p&gt;&lt;strong&gt;Intro&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;SQL Server Management Studio (SSMS) is a great product. Out of the box SSMS is an awesome tool that many of us have come to know and love. In my quest for efficiency I have found some very helpful settings that can be changed. If you spend most of your day in SSMS like I do, these changes can help you be more productive.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Version&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;First and foremost is the version you are running. If you aren&amp;rsquo;t running the latest version of SSMS go &lt;a href="https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms"&gt;download&lt;/a&gt; it now. It&amp;rsquo;s free! SSMS has received a lot of love from Microsoft over the last couple years. Now updates come out regularly instead of with the SQL Server release cycle. If you are still running SSMS 2005 I’m begging you to go download the latest version and give it a try.&lt;/p&gt;</description></item><item><title>Installing dbatools</title><link>https://dataartisans.tech/installing-dbatools/</link><pubDate>Tue, 07 Apr 2020 00:00:00 +0000</pubDate><guid>https://dataartisans.tech/installing-dbatools/</guid><description>&lt;p&gt;I had some issues installing &lt;a href="https://dbatools.io/"&gt;dbatools&lt;/a&gt; over the weekend and wanted to share my experience. If you have not heard of dbatools I encourage you to go check it out and see what it can do.&lt;/p&gt;
&lt;p&gt;The easiest method to install dbatools is to open PowerShell as administrator and run the following command:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-powershell" data-lang="powershell"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Install-Module dbatools
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Following the &lt;a href="https://dbatools.io/download/"&gt;install instructions on the dbatools website&lt;/a&gt; and other relevant blog posts around the web the install should be as easy as that. In my case it was not.&lt;/p&gt;</description></item><item><title>First 3 SQL Server Settings to Check</title><link>https://dataartisans.tech/first-3-sql-server-settings-to-check/</link><pubDate>Fri, 20 Jul 2018 00:00:00 +0000</pubDate><guid>https://dataartisans.tech/first-3-sql-server-settings-to-check/</guid><description>&lt;p&gt;You are handed a SQL Server that someone else set up and has, or more likely has not, maintained over time. You are now responsible for this server, but have limited time to check it out because of your busy schedule. What are your first 3 SQL Server settings to check?&lt;/p&gt;
&lt;h4 id="1-backups"&gt;1. &lt;strong&gt;Backups&lt;/strong&gt;&lt;/h4&gt;
&lt;p&gt;This should always without a doubt be the first thing you check. If backups are failing or even are non existent, you need to know about it and make it your first priority to fix. Now that this server is your responsibility, the business is going to look at you when the server crashes and they need a restore. Not being able to recover any data is a great way to get fired!&lt;/p&gt;</description></item><item><title>CTE: Make Your Data Easier to Query</title><link>https://dataartisans.tech/cte-how-to-make-your-data-easier-to-query/</link><pubDate>Mon, 09 Jul 2018 00:00:00 +0000</pubDate><guid>https://dataartisans.tech/cte-how-to-make-your-data-easier-to-query/</guid><description>&lt;p&gt;Ever wish your data was a little different so it is easier to query? Don&amp;rsquo;t fret, we have all had those queries that are gigantic and become too cumbersome to read through or modify. A CTE, a.k.a. Common Table Expression, can be the savior you have been wishing for. They are great for separating different pieces of your query and performing some tasks before your query runs.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;To use a CTE:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Reset SQL Server sa Password</title><link>https://dataartisans.tech/how-to-reset-sql-server-sa-password/</link><pubDate>Tue, 26 Sep 2017 00:00:00 +0000</pubDate><guid>https://dataartisans.tech/how-to-reset-sql-server-sa-password/</guid><description>&lt;p&gt;Once upon a time a vendor set up a new SQL Server at the company I was working for. For whatever reason they decided it best to not work with the local DBA. A few weeks later a server admin emails me asking if I can help out with an issue they were having. He says the vendor has lost the sa password and cannot connect to the SQL Server instance. After having a good chuckle I agreed to help out and reset the SQL Server sa password. Here is how I did it:&lt;/p&gt;</description></item></channel></rss>