<?xml version="1.0" encoding="UTF-8" standalone="no"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" version="2.0">

<channel>
	<title>MarlonRibunal.com</title>
	<atom:link href="https://marlonribunal.com/feed/?max-results=10" rel="self" type="application/rss+xml"/>
	<link>https://marlonribunal.com</link>
	<description>SQL, Code, Coffee, etc.</description>
	<lastBuildDate>Tue, 04 Aug 2026 07:14:20 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.2</generator>
	<xhtml:meta content="noindex" name="robots" xmlns:xhtml="http://www.w3.org/1999/xhtml"/><item>
		<title>How I Troubleshoot a Slow SQL Server Live</title>
		<link>https://marlonribunal.com/how-i-troubleshoot-a-slow-sql-server-live/</link>
					<comments>https://marlonribunal.com/how-i-troubleshoot-a-slow-sql-server-live/#respond</comments>
		
		<dc:creator><![CDATA[Marlon Ribunal]]></dc:creator>
		<pubDate>Tue, 04 Aug 2026 11:10:00 +0000</pubDate>
				<category><![CDATA[How-To]]></category>
		<category><![CDATA[SQL Server]]></category>
		<guid isPermaLink="false">https://marlonribunal.com/?p=2782</guid>

					<description><![CDATA[<p>No two SQL Server environments are alike. A fix that resolves a performance issue in one environment may not work in another because every SQL Server instance has different workloads, hardware, data distribution, application behavior, and configuration. Even if you reproduce an issue in a test environment, there's no guarantee the same solution will produce identical results in production.</p>
<p>So, probably instead of establishing a rigid step-by-step process, putting together a repeatable methodology can lead you to a resolution. This will eliminate blind guesses and at least bring you to an educated guess if the issue is too complicated. <a href="https://marlonribunal.com/how-i-troubleshoot-a-slow-sql-server-live/">Continue reading <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a href="https://marlonribunal.com/how-i-troubleshoot-a-slow-sql-server-live/">How I Troubleshoot a Slow SQL Server Live</a> first appeared on <a href="https://marlonribunal.com">SQL, Code, Coffee, Etc.</a>.</p>]]></description>
										<content:encoded><![CDATA[<p class="wp-block-paragraph">No two SQL Server environments are alike. A fix that resolves a performance issue in one environment may not work in another because every SQL Server instance has different workloads, hardware, data distribution, application behavior, and configuration. Even if you reproduce an issue in a test environment, there&#8217;s no guarantee the same solution will produce identical results in production.</p>



<p class="wp-block-paragraph">So, probably instead of establishing a rigid step-by-step process, putting together a repeatable methodology can lead you to a resolution. This will eliminate blind guesses and at least bring you to an educated guess if the issue is too complicated.</p>



<p class="wp-block-paragraph">A common workflow for troubleshooting performance issues on SQL Server may involve the following. But again, these are not necessarily phases or stages that you have to follow in a specific order. Real-world troubleshooting rarely happens in a perfect sequence. You may jump between these areas, revisit previous findings, or investigate multiple things simultaneously depending on the complexity of the issue.</p>



<ol class="wp-block-list">
<li>Define the scope</li>



<li>Determine what changed</li>



<li>Measure server health</li>



<li>Identify bottlenecks</li>



<li>Investigate the root cause</li>



<li>Validate the fix / Monitor after implementation</li>



<li>Document the incident</li>
</ol>



<h2 class="wp-block-heading">Scope it first</h2>



<p class="wp-block-paragraph">Every time I get a call about slow performance, the first thing I want to do is qualify the question itself. What does <em>slow</em> mean? Is it a widget that used to run for a few seconds and is now running for five minutes? By the way, this is one of the most common &#8220;slow&#8221; incidents I&#8217;ve seen in my last job at an ISV.</p>



<p class="wp-block-paragraph">Scoping and discovery are probably the most critical parts of any troubleshooting task. This is the part where you can grasp the scope and nature of the issue at hand. Here, you will probably be able to establish your footing on how to approach the issue. Of course, a batch job running in SSIS or SQL Server Agent will require a different approach than, say, a process triggered by a user in the application&#8217;s frontend.</p>



<p class="wp-block-paragraph">And, again, as I&#8217;ve said in my other <strong><a href="https://marlonribunal.com/do-this-before-you-contact-your-sql-server-consultant/" target="_blank" rel="noopener" title="post">post</a></strong>, I think it&#8217;s important to know when this issue started occurring. That alone might reveal a few important details about the very nature of the issue. Knowing whether you&#8217;re dealing with a single bad query or a server-wide issue will prevent you from investigating the wrong layer of the stack. For all you know, it&#8217;s not a performance issue at all, but a slowdown caused by the user&#8217;s ISP while working from home. I&#8217;ve seen this many times before.</p>



<p class="wp-block-paragraph">My typical goal at the onset is to reproduce or replicate the issue in a test environment. That can give you the most bang for your buck because it allows you to investigate the issue and test potential solutions in a controlled environment. </p>



<p class="wp-block-paragraph">The one thing we&#8217;re trying to prevent in the scoping is getting down the proverbial rabbit hole or chasing that red herring. Yes, I still love using those idioms in real life.</p>



<h2 class="wp-block-heading">What changed?</h2>



<p class="wp-block-paragraph">Actually, this should be part of scoping, but I think it merits a whole section of its own. Knowing what changed could hold critical information as to the reason behind the issue. Maybe somebody just tweaked some lever on the application side, and that kind of caused a domino effect of some sort.<br /><br />The main goal here is to find all the possible root causes and not point fingers at whoever might have been involved. There are a ton of reasons why a SQL Server might suddenly run slow. Configuration changes, new procedures, introduction of new indexes, unanticipated workload, network I/O, and even user workflows can cause slowdowns given the right circumstances where SQL Server can really slow down.</p>



<p class="wp-block-paragraph">I&#8217;d start with the most recent change. And, of course, the typical answer to &#8220;What changed?&#8221; is almost always &#8220;nothing.&#8221; So, it&#8217;s up to you to determine how you surface what actually changed, if anything.</p>



<h2 class="wp-block-heading">Know your baseline</h2>



<p class="wp-block-paragraph">If nothing has changed at all, then the next step is to determine any other activities that could be affecting the particular issue that you are investigating. It&#8217;s possible that the slowdown is caused by another task that is not necessarily related to the slowdown issue but is somehow affecting, for example, server resources.</p>



<p class="wp-block-paragraph">I&#8217;ve seen cases where a third party started to send an amount of data that was not typical for an intra-day workload, which caused a domino effect on normal business operations. Not knowing what a &#8220;typical intra-day workload&#8221; looks like can complicate your investigation because you wouldn&#8217;t know if things are a factor in the issue or not.</p>



<p class="wp-block-paragraph">For example, high CPU isn&#8217;t automatically a problem if the server normally runs at 90% CPU during month-end processing. While a query that normally consumes an infinitesimal amount of CPU and is suddenly taking 30% of the total CPU is almost certainly an issue. Always compare current metrics against a known baseline before concluding that something is abnormal.</p>



<h2 class="wp-block-heading">Paul can tell you where it hurts</h2>



<p class="wp-block-paragraph">If you haven&#8217;t identified a possible root cause or figured out a narrative that may possibly connect the dots at this point, then it&#8217;s time to dig deeper. Paul Randal&#8217;s wait stats <a href="https://www.sqlskills.com/blogs/paul/wait-statistics-or-please-tell-me-where-it-hurts/" target="_blank" rel="noopener nofollow" title=""><strong>query</strong></a> can surface some clues about the ongoing issue. If you are troubleshooting a live issue, you probably want to combine that with Paul&#8217;s waiting task <strong><a href="https://www.sqlskills.com/blogs/paul/updated-sys-dm_os_waiting_tasks-script-to-correctly-parse-nodeid/" target="_blank" rel="noopener nofollow" title="">query</a></strong>. Glenn Berry&#8217;s Diagnostic <a href="https://glennsqlperformance.com/" target="_blank" rel="noopener nofollow" title=""><strong>queries</strong></a> are a must-have tool for any SQL Server DBA. If you are like me, when I encounter slow issues that are happening live, my instinct is to run Adam Machanic&#8217;s sp_whoisactive <strong><a href="http://whoisactive.com/downloads/" target="_blank" rel="noopener nofollow" title="">procedure</a></strong>. For many others running Brent O&#8217;s <code>sp_BlitzFirst</code> <strong><a href="https://www.brentozar.com/sql/wait-stats/" target="_blank" rel="noopener nofollow" title="">procedure</a></strong> is their go-to. </p>



<p class="wp-block-paragraph">Wait stats and waiting tasks can be a superpower when it comes to troubleshooting a performance issue. Here is an <strong><a href="https://marlonribunal.com/waiting-tasks-reveal-pain-points/" target="_blank" rel="noopener" title="">example of how I used these two</a></strong> in the past to troubleshoot a live performance issue.</p>



<p class="wp-block-paragraph">The wait type typically tells you where to go next. For example, blocking and lock waits send you to the head blocker (<code>sp_WhoIsActive</code> does a great job at identifying this). <code>PAGEIOLATCH</code> sends you toward storage I/O issues or queries performing large reads, possibly due to missing indexes. <code>RESOURCE_SEMAPHORE</code> points you toward memory grant pressure, while <code>SOS_SCHEDULER_YIELD</code> points toward CPU pressure. <code>CXCONSUMER</code> can be a benign wait type, but you should still investigate whether it is contributing to a bottleneck in a highly concurrent system.</p>



<p class="wp-block-paragraph">Wait stats can help you identify the type of bottleneck SQL Server is experiencing, whether it&#8217;s related to I/O, CPU pressure, memory pressure, locking, or other resource contention.</p>



<h2 class="wp-block-heading">Resource utilization</h2>



<p class="wp-block-paragraph">Ok, just like with wait stats, if you need to dig deeper, you should look into system resources as well. There is only so much you can achieve by optimizing indexes and queries. At some point, you need to ask whether the server has enough resources to handle the workload it is being asked to process. A perfectly tuned query can still struggle if the underlying infrastructure is already under pressure.</p>



<p class="wp-block-paragraph">Here&#8217;s what I had to say about Disk IO on a LinkedIn <strong><a href="https://www.linkedin.com/posts/marlonribunal_sqlserver-activity-7481394723207925760-CctB?utm_source=share&amp;utm_medium=member_desktop&amp;rcm=ACoAABwvznYB3NldBkI_v2xrEy5IdizQkSdAo3Q" target="_blank" rel="noopener nofollow" title="">post</a></strong>:</p>



<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="509" height="400" src="https://marlonribunal.com/wp-content/uploads/2026/07/image-32.png" alt="IOPS and Throughput (MB/s) in SQL Server" class="wp-image-2853" srcset="https://marlonribunal.com/wp-content/uploads/2026/07/image-32.png 509w, https://marlonribunal.com/wp-content/uploads/2026/07/image-32-300x236.png 300w" sizes="(max-width: 509px) 100vw, 509px" /></figure>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">The key here is understanding whether you are dealing with a query problem, a workload problem, or a capacity problem. You can only go so far with index tuning and query optimization if the real issue is resource pressure underneath. </p>



<p class="wp-block-paragraph">At some point, you have to understand what SQL Server is waiting on and whether the current infrastructure can support the workload. <strong>This is where troubleshooting becomes less about applying fixes and more about understanding the behavior of the system as a whole.</strong></p>



<h2 class="wp-block-heading">Bottleneck at the query level</h2>



<p class="wp-block-paragraph">We&#8217;re at the point where we are ruling out server-wide issues and closing in on specific queries that may be contributing to the problem. This is where tools like Query Store become extremely valuable because they allow you to look back at query behavior over time instead of relying only on what is happening at the exact moment of the incident.<br /><br />One thing that I have been trying to learn lately is Query Store. At the time of writing, I am taking the SQLskills course on Query Store, <strong><a href="https://www.sqlskills.com/sql-server-training/ieqs/" target="_blank" rel="noopener nofollow" title="">IEQS</a></strong>. The more I learn about it, the more I realize how useful it can be when troubleshooting query performance issues, especially when dealing with plan regressions or queries that suddenly start behaving differently.</p>



<p class="wp-block-paragraph">Of course, actual execution plans can give you a lot of information about where the bottleneck is occurring at the query level. Is it a cardinality estimation issue, memory grant pressure, spills, missing indexes, outdated statistics, or even parameter sniffing? The information you can glean from execution plans or Query Store can help you understand why a query is behaving the way it is and guide you toward the right tuning approach.</p>



<h2 class="wp-block-heading">Is it blocking</h2>



<p class="wp-block-paragraph">If it&#8217;s a blocking chain, the first thing you want to do is find the head blocker and understand what it is doing before you start killing sessions. A blocked session is usually just a victim waiting for something else to finish. The real question is: what is holding the lock, and why is it taking so long?</p>



<p class="wp-block-paragraph">This is where experience and judgment come into play. Just because you found a blocking session does not mean the immediate answer is to kill it. You need to understand what the session is doing, how long it has been running, and what impact terminating it will have. One interesting case I encountered in the past is a <strong><a href="https://marlonribunal.com/killing-service-broker-spid/" target="_blank" rel="noopener nofollow" title="">Service Broker queue that got stuck in limbo</a></strong>.</p>



<h2 class="wp-block-heading">Communicate to stakeholders</h2>



<p class="wp-block-paragraph">During an incident, people understand that troubleshooting takes time. What they don&#8217;t want is uncertainty and silence while the issue is impacting the business. Keeping stakeholders informed shows that you are engaged, even when the root cause has not been identified yet.</p>



<p class="wp-block-paragraph">In my experience, you don&#8217;t always have to provide a breakthrough every time you communicate. Sometimes a simple update like &#8220;we are seeing high I/O waits, we are checking storage latency, and we are looking at the queries involved&#8221; is enough to keep everyone aligned. The technical investigation may still be in progress, but at least everyone understands where things stand.</p>



<h2 class="wp-block-heading">Validate the fix</h2>



<p class="wp-block-paragraph">Once the fix has been implemented, the work is not done yet. This is where you go back and validate if the change actually fixed the problem. Did the waits decrease? Did CPU return to its normal behavior? Did response times improve? Did the blocking clear? And probably the most important question: did the users notice the improvement?</p>



<p class="wp-block-paragraph">One thing I always try to avoid is assuming that the issue is fixed just because the immediate symptom disappeared. A SQL Server environment is a complex system, and sometimes fixing one problem can expose another one. Keep monitoring after the change and make sure that things continue to behave as expected.</p>



<p class="wp-block-paragraph">I&#8217;ve seen cases where a change looked successful during the initial troubleshooting session, only to find out later that the original problem came back or another issue surfaced. This is why validation and monitoring after the change are just as important as finding the fix in the first place.</p>



<h2 class="wp-block-heading">Document the incident</h2>



<p class="wp-block-paragraph">Document what happened, what you checked, and what fixed the issue. Include the root cause, symptoms, timeline, diagnostics, fix, and any lessons learned. The next time a similar incident happens, this documentation can save you from starting the investigation from scratch.</p>



<p class="wp-block-paragraph">Effective SQL Server troubleshooting is less about having the perfect fix ready and more about knowing how to narrow down the possibilities. You start with what you know, gather evidence, validate your assumptions, and slowly eliminate what doesn&#8217;t fit.</p>



<p class="wp-block-paragraph">In my experience, the DBAs who troubleshoot well are not the ones who have memorized every possible solution. They are the ones who know how to ask the right questions, understand what the system is telling them, and make changes based on evidence. Having a repeatable methodology will take you much further than a collection of random tuning techniques.</p>



<p class="wp-block-paragraph">Well, take it with a grain of salt. It depends. It always is.</p>



<p class="wp-block-paragraph"></p><p>The post <a href="https://marlonribunal.com/how-i-troubleshoot-a-slow-sql-server-live/">How I Troubleshoot a Slow SQL Server Live</a> first appeared on <a href="https://marlonribunal.com">SQL, Code, Coffee, Etc.</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://marlonribunal.com/how-i-troubleshoot-a-slow-sql-server-live/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Provision an Azure SQL Database</title>
		<link>https://marlonribunal.com/how-to-provision-an-azure-sql-database/</link>
					<comments>https://marlonribunal.com/how-to-provision-an-azure-sql-database/#respond</comments>
		
		<dc:creator><![CDATA[Marlon Ribunal]]></dc:creator>
		<pubDate>Thu, 30 Jul 2026 11:15:00 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<guid isPermaLink="false">https://marlonribunal.com/?p=2717</guid>

					<description><![CDATA[<p>Aside from spinning up a SQL Server instance container, the free Azure SQL Database is another great tool for learning SQL. You can even use it for low-traffic or lightweight app. See the documentations for the limits. I will not &#8230; <a href="https://marlonribunal.com/how-to-provision-an-azure-sql-database/">Continue reading <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a href="https://marlonribunal.com/how-to-provision-an-azure-sql-database/">How to Provision an Azure SQL Database</a> first appeared on <a href="https://marlonribunal.com">SQL, Code, Coffee, Etc.</a>.</p>]]></description>
										<content:encoded><![CDATA[<p class="wp-block-paragraph">Aside from spinning up a SQL Server instance container, the free Azure SQL Database is another great tool for learning SQL. You can even use it for low-traffic or lightweight app. See the documentations for the limits. I will not be responsible for your usage. <br /><br />That said, let&#8217;s provision the database.</p>



<h2 class="wp-block-heading">Provision an Azure SQL Database</h2>



<p class="wp-block-paragraph">Go to you Azure Portal and search for Azure SQL Database</p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="539" src="https://marlonribunal.com/wp-content/uploads/2026/07/image-19-1024x539.png" alt="" class="wp-image-2727" srcset="https://marlonribunal.com/wp-content/uploads/2026/07/image-19-1024x539.png 1024w, https://marlonribunal.com/wp-content/uploads/2026/07/image-19-300x158.png 300w, https://marlonribunal.com/wp-content/uploads/2026/07/image-19-768x404.png 768w, https://marlonribunal.com/wp-content/uploads/2026/07/image-19-1536x809.png 1536w, https://marlonribunal.com/wp-content/uploads/2026/07/image-19-scaled.png 2048w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">On the upper left-hand of the UI, click on <strong>Create</strong> and select <strong>SQL database (Free offer)</strong>.<br /><br />Configuring an Azure SQL Database is pretty much intutive. For the Server option, use an existing SQL Database Server or create a new one. <br /><br />Click <strong>Review + create</strong> to finish the setup.</p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="914" src="https://marlonribunal.com/wp-content/uploads/2026/07/image-21-1024x914.png" alt="" class="wp-image-2729" srcset="https://marlonribunal.com/wp-content/uploads/2026/07/image-21-1024x914.png 1024w, https://marlonribunal.com/wp-content/uploads/2026/07/image-21-300x268.png 300w, https://marlonribunal.com/wp-content/uploads/2026/07/image-21-768x686.png 768w, https://marlonribunal.com/wp-content/uploads/2026/07/image-21-1536x1371.png 1536w, https://marlonribunal.com/wp-content/uploads/2026/07/image-21-scaled.png 2048w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<h2 class="wp-block-heading">Connect from VS Code on a MacBook</h2>



<p class="wp-block-paragraph">Go to your Resource Group and find your Azure SQL Database. Or, you can simply search for Azure SQL Database in the search bar again and that will take you to your databases.</p>



<p class="wp-block-paragraph">Copy the Server name.</p>



<p class="wp-block-paragraph">Now, open your VS Code (install the <code>mssql</code> extension if you haven&#8217;t already). Why VS Code? That&#8217;s because Mirosoft will never port SSMS to macOS. That&#8217;s why.<br /><br />Create new connection. Look for the plug icon with the &#8216;+&#8217; sign next to it.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="674" height="470" src="https://marlonribunal.com/wp-content/uploads/2026/07/image-23.png" alt="" class="wp-image-2735" srcset="https://marlonribunal.com/wp-content/uploads/2026/07/image-23.png 674w, https://marlonribunal.com/wp-content/uploads/2026/07/image-23-300x209.png 300w" sizes="auto, (max-width: 674px) 100vw, 674px" /></figure>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">For the Input type, <strong>Browse Azure</strong> wouldn&#8217;t work for me even if I already took care of the networking setting. Let me know in the comment if you made it work. Using <strong>Parameters </strong>worked for me. <br /><br />Paste the <strong>Server name</strong>. Don&#8217;t forget to tick the <strong>Trust server certificate</strong>. Use <strong>SQL login</strong> and input the sa user and password that you set when you provisioned your SQL Server.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="643" src="https://marlonribunal.com/wp-content/uploads/2026/07/image-25-1024x643.png" alt="" class="wp-image-2738" srcset="https://marlonribunal.com/wp-content/uploads/2026/07/image-25-1024x643.png 1024w, https://marlonribunal.com/wp-content/uploads/2026/07/image-25-300x188.png 300w, https://marlonribunal.com/wp-content/uploads/2026/07/image-25-768x483.png 768w, https://marlonribunal.com/wp-content/uploads/2026/07/image-25-1536x965.png 1536w, https://marlonribunal.com/wp-content/uploads/2026/07/image-25-scaled.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">That should be it. Your Azure SQL Database is now ready to use.<br /><br /></p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="780" src="https://marlonribunal.com/wp-content/uploads/2026/07/image-27-1024x780.png" alt="" class="wp-image-2742" srcset="https://marlonribunal.com/wp-content/uploads/2026/07/image-27-1024x780.png 1024w, https://marlonribunal.com/wp-content/uploads/2026/07/image-27-300x228.png 300w, https://marlonribunal.com/wp-content/uploads/2026/07/image-27-768x585.png 768w, https://marlonribunal.com/wp-content/uploads/2026/07/image-27-1536x1170.png 1536w, https://marlonribunal.com/wp-content/uploads/2026/07/image-27.png 1610w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure><p>The post <a href="https://marlonribunal.com/how-to-provision-an-azure-sql-database/">How to Provision an Azure SQL Database</a> first appeared on <a href="https://marlonribunal.com">SQL, Code, Coffee, Etc.</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://marlonribunal.com/how-to-provision-an-azure-sql-database/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Introducing azsql-migration-test: Test and Validate Azure SQL Database Migrations</title>
		<link>https://marlonribunal.com/introducing-azsql-migration-test-test-and-validate-azure-sql-database-migrations/</link>
					<comments>https://marlonribunal.com/introducing-azsql-migration-test-test-and-validate-azure-sql-database-migrations/#respond</comments>
		
		<dc:creator><![CDATA[Marlon Ribunal]]></dc:creator>
		<pubDate>Sun, 26 Jul 2026 10:15:00 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<guid isPermaLink="false">https://marlonribunal.com/?p=2818</guid>

					<description><![CDATA[<p>Introducing azsql-migration-test, a small open-source CLI that validates your Azure SQL Database migrations against a local Azure SQL Database Developer container — the same engine as the cloud, running on your machine.</p>
<p>The problem: proving a migration works shouldn’t require the cloud. <a href="https://marlonribunal.com/introducing-azsql-migration-test-test-and-validate-azure-sql-database-migrations/">Continue reading <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a href="https://marlonribunal.com/introducing-azsql-migration-test-test-and-validate-azure-sql-database-migrations/">Introducing azsql-migration-test: Test and Validate Azure SQL Database Migrations</a> first appeared on <a href="https://marlonribunal.com">SQL, Code, Coffee, Etc.</a>.</p>]]></description>
										<content:encoded><![CDATA[<p class="wp-block-paragraph"><strong><em>Disclaimer: Built with Claude Code </em></strong><br /><br />Introducing <strong><code>azsql-migration-test</code></strong>, a small open-source CLI that validates your Azure SQL Database migrations against a local Azure SQL Database Developer container — the same engine as the cloud, running on your machine.</p>



<p class="wp-block-paragraph">The problem: <strong>proving a migration works shouldn&#8217;t require the cloud</strong></p>



<p class="wp-block-paragraph">If you run Azure SQL Database, you want to know a schema migration will succeed before you apply it in production. But the honest way to be sure has always meant testing against a live Azure SQL Database — which means a subscription, cloud spend, and slow round-trips every time you tweak the migration.</p>



<p class="wp-block-paragraph">So validation gets rushed, done once instead of continuously, or skipped until staging — and the surprises show up late, mid-release, when they&#8217;re most expensive.</p>



<p class="wp-block-paragraph">What&#8217;s been missing is a way to validate a migration against the actual Azure SQL Database engine, locally, repeatably, and for free.</p>



<h2 class="wp-block-heading">What it is</h2>



<p class="wp-block-paragraph"><strong>Azure SQL Developer</strong> is the Azure SQL Database engine packaged as a local container. It&#8217;s the real thing running on your laptop — what works there deploys seamlessly to Azure SQL Database. More info on SQL Database Developer can be found <a href="https://microsoft.github.io/azure-sql-database-container/" title="">here</a>. Youtube Demo provided by MSFT can be found <a href="https://www.youtube.com/watch?v=eIkX-ypBkko" title="">here</a>.</p>



<p class="wp-block-paragraph"><code>azsql-migration-test</code> automates the validation loop against it:</p>



<ol class="wp-block-list">
<li>Pull and start the Developer container.</li>



<li>Extract your source schema (with sqlpackage).</li>



<li>Deploy it into the container — the real compatibility test: if the engine won&#8217;t accept the schema, the deploy fails and so does validation.</li>



<li>Replay your queries against the deployed schema.</li>



<li>Tear everything down.</li>
</ol>



<p class="wp-block-paragraph">No cloud account. No cloud cost. Zero-to-answer in a couple of minutes — and because it&#8217;s the same engine you deploy to, a clean pass means a clean deploy.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="494" src="https://marlonribunal.com/wp-content/uploads/2026/07/source-vs-container-1024x494.png" alt="" class="wp-image-2832" srcset="https://marlonribunal.com/wp-content/uploads/2026/07/source-vs-container-1024x494.png 1024w, https://marlonribunal.com/wp-content/uploads/2026/07/source-vs-container-300x145.png 300w, https://marlonribunal.com/wp-content/uploads/2026/07/source-vs-container-768x370.png 768w, https://marlonribunal.com/wp-content/uploads/2026/07/source-vs-container-1536x741.png 1536w, https://marlonribunal.com/wp-content/uploads/2026/07/source-vs-container-2048x987.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h2 class="wp-block-heading">The three commands</h2>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"><strong><code>validate</code> </strong>— the full pass</p>



<p class="wp-block-paragraph">Extract the source schema, deploy it into the container (the compatibility test), then replay your queries against it:</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#292d3e"><span style="background:#aaafcf;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#292d3e">Zsh</span></span><span role="button" tabindex="0" style="color:#babed8;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>azsql-migration-test validate \
--source "Server=;Database=;User Id=;Password=" \
--queries ./queries.sql</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki material-theme-palenight" style="background-color: #292D3E" tabindex="0"><code><span class="line"><span style="color: #FFCB6B">azsql-migration-test</span><span style="color: #BABED8"> </span><span style="color: #C3E88D">validate</span><span style="color: #BABED8"> \</span></span>
<span class="line"><span style="color: #BABED8">--source </span><span style="color: #89DDFF">&quot;</span><span style="color: #C3E88D">Server=;Database=;User Id=;Password=</span><span style="color: #89DDFF">&quot;</span><span style="color: #BABED8"> \</span></span>
<span class="line"><span style="color: #BABED8">--queries </span><span style="color: #C3E88D">./queries.sql</span></span></code></pre></div>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"><code>✓ Schema deployed to Azure SQL Database Developer (compatible)<br />✓ Query replay complete: 12 passed, 0 failed<br />Migration validation completed successfully</code></p>



<p class="wp-block-paragraph">If the schema is rejected or a query fails, it exits non-zero — so it drops straight into a script or a CI job.</p>



<p class="wp-block-paragraph"><strong><code>compare</code></strong> — a non-destructive deployment dry-run</p>



<p class="wp-block-paragraph">Report exactly what deploying your schema would do — every operation sqlpackage would run against the Azure SQL Database engine — without applying anything:</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#292d3e"><span style="background:#aaafcf;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#292d3e">Zsh</span></span><span role="button" tabindex="0" style="color:#babed8;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>azsql-migration-test compare \
--source "Server=;Database=;User Id=;Password="</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki material-theme-palenight" style="background-color: #292D3E" tabindex="0"><code><span class="line"><span style="color: #FFCB6B">azsql-migration-test</span><span style="color: #BABED8"> </span><span style="color: #C3E88D">compare</span><span style="color: #BABED8"> \</span></span>
<span class="line"><span style="color: #BABED8">--source </span><span style="color: #89DDFF">&quot;</span><span style="color: #C3E88D">Server=;Database=;User Id=;Password=</span><span style="color: #89DDFF">&quot;</span></span></code></pre></div>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">✓ Schema comparison complete</p>



<p class="wp-block-paragraph">You get a <code>report.md</code> summary and the raw <code>schema-diff.xml</code>:</p>



<p class="wp-block-paragraph"><code>Schema<br />Changes: 4 (breaking: false)<br />DeployReport: schema-diff.xml</code></p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Against a fresh target this is the full create plan; against a database that already has a schema (e.g. from a prior validate <code>--keep</code>) it&#8217;s the incremental diff — creates, alters, and drops. It exits non-zero when the plan contains a breaking operation — a drop or a data-loss alert — so it makes a clean pre-merge gate.</p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">It exits non-zero when the diff contains a breaking operation — a drop or a data-loss alert — so it makes a clean pre-merge gate.</p>



<p class="wp-block-paragraph"><code><strong>replay</strong></code> — run a query set</p>



<p class="wp-block-paragraph">Run a set of GO-separated batches against a database and get per-batch pass/fail and timing:</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#292d3e"><span style="background:#aaafcf;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#292d3e">Zsh</span></span><span role="button" tabindex="0" style="color:#babed8;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>azsql-migration-test replay --queries ./smoke.sql --database MyDb</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki material-theme-palenight" style="background-color: #292D3E" tabindex="0"><code><span class="line"><span style="color: #FFCB6B">azsql-migration-test</span><span style="color: #BABED8"> </span><span style="color: #C3E88D">replay</span><span style="color: #BABED8"> </span><span style="color: #C3E88D">--queries</span><span style="color: #BABED8"> </span><span style="color: #C3E88D">./smoke.sql</span><span style="color: #BABED8"> </span><span style="color: #C3E88D">--database</span><span style="color: #BABED8"> </span><span style="color: #C3E88D">MyDb</span></span></code></pre></div>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"><code>✓ Query replay complete: 8 passed, 0 failed</code></p>



<p class="wp-block-paragraph">A failing batch exits non-zero and the SQL error is captured in the report:</p>



<p class="wp-block-paragraph"><code>[FAIL] SELECT * FROM dbo.Orders_old; (168ms)<br />Msg 208, Level 16, State 1 — Invalid object name 'dbo.Orders_old'.</code></p>



<h2 class="wp-block-heading">Where it fits: use cases</h2>



<ul class="wp-block-list">
<li>A pre-deploy gate on your laptop. Before you open the PR, confirm the migration will be accepted by the Azure SQL Database engine.</li>



<li>A CI/CD check. Every command exits non-zero on failure, so you can wire it into a pipeline that blocks a merge or a deploy on a migration that won&#8217;t apply.</li>



<li>Repeatable validation across a migration project. Instead of a one-time cloud assessment, re-run it on every change — locally, for free.</li>



<li>Vetting third-party or generated migration scripts. Point it at a schema you didn&#8217;t write and see whether the engine accepts it before it reaches production.</li>



<li>Fast iteration. Change the migration, re-validate in a couple of minutes, no cloud round-trip.</li>
</ul>



<h2 class="wp-block-heading">Honest about what it does</h2>



<p class="wp-block-paragraph">Good tooling tells you where it stops. The breaking-change flag is derived from the sqlpackage DeployReport (drops and data-loss alerts); the full XML report is always written, so you can inspect the deployment plan yourself. As with any pre-deploy check, keep your normal staged rollout — but you&#8217;ll catch the schema problems that otherwise surface at deploy time, right on your laptop.</p>



<p class="wp-block-paragraph">Try it in two minutes</p>



<p class="wp-block-paragraph">Download a binary from the latest release (https://github.com/MarlonRibunal/azsql-migration-test/releases) (each ships with checksums), or:</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#292d3e"><span style="background:#aaafcf;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#292d3e">Zsh</span></span><span role="button" tabindex="0" style="color:#babed8;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>go install github.com/MarlonRibunal/azsql-migration-test@latest</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki material-theme-palenight" style="background-color: #292D3E" tabindex="0"><code><span class="line"><span style="color: #FFCB6B">go</span><span style="color: #BABED8"> </span><span style="color: #C3E88D">install</span><span style="color: #BABED8"> </span><span style="color: #C3E88D">github.com/MarlonRibunal/azsql-migration-test@latest</span></span></code></pre></div>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Point it at an Azure SQL Database Developer container image you have access to (and its registry credentials, if needed) via environment variables, then run validate. Full quickstart and flags are in the README (https://github.com/MarlonRibunal/azsql-migration-test#readme).</p>



<p class="wp-block-paragraph">You&#8217;ll need Docker and sqlpackage on your PATH. (sqlcmd runs inside the container, so you don&#8217;t need it on the host.)</p>



<h2 class="wp-block-heading">Contribute — it&#8217;s small on purpose</h2>



<p class="wp-block-paragraph">azsql-migration-test is a compact, dependency-free Go CLI. That&#8217;s deliberate: it&#8217;s easy to read, easy to build, and easy to contribute to. If you work with Azure SQL migrations, there&#8217;s low-hanging fruit here:</p>



<ul class="wp-block-list">
<li>Richer DeployReport parsing and smarter breaking-change classification.</li>



<li>A first-class GitHub Action wrapper for the CI use case.</li>



<li>More output formats (JSON, SARIF) for pipeline integration.</li>



<li>Real-world schema fixtures and edge cases worth validating against.</li>
</ul>



<p class="wp-block-paragraph">Issues and PRs are welcome — see CONTRIBUTING (https://github.com/MarlonRibunal/azsql-migration-test/blob/main/CONTRIBUTING.md). If it saved you a bad deploy, a <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2b50.png" alt="⭐" class="wp-smiley" style="height: 1em; max-height: 1em;" /> on the repo helps others find it.</p>



<p class="wp-block-paragraph">→ <a href="https://github.com/MarlonRibunal/azsql-migration-test" title="">https://github.com/MarlonRibunal/azsql-migration-test</a></p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p class="wp-block-paragraph"><code><strong>azsql-migration-test</strong></code> is an independent, community project. It is not affiliated with, endorsed by, or sponsored by <strong>Microsoft</strong>. &#8220;Azure&#8221; and &#8220;Azure SQL Database&#8221; are trademarks of Microsoft Corporation.</p>



<p class="wp-block-paragraph"></p><p>The post <a href="https://marlonribunal.com/introducing-azsql-migration-test-test-and-validate-azure-sql-database-migrations/">Introducing azsql-migration-test: Test and Validate Azure SQL Database Migrations</a> first appeared on <a href="https://marlonribunal.com">SQL, Code, Coffee, Etc.</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://marlonribunal.com/introducing-azsql-migration-test-test-and-validate-azure-sql-database-migrations/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Getting Started with Azure SQL Developer on Macbook</title>
		<link>https://marlonribunal.com/getting-started-with-azure-sql-developer-on-macbook/</link>
					<comments>https://marlonribunal.com/getting-started-with-azure-sql-developer-on-macbook/#respond</comments>
		
		<dc:creator><![CDATA[Marlon Ribunal]]></dc:creator>
		<pubDate>Thu, 23 Jul 2026 11:01:00 +0000</pubDate>
				<category><![CDATA[Learning]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Tools]]></category>
		<guid isPermaLink="false">https://marlonribunal.com/?p=2800</guid>

					<description><![CDATA[<p>The idea behind Azure SQL Developer is for anyone to build, iterate, and test locally at no cost. This means NO Azure subscription to deal with and NO credit card required! Everything will work seamlessly when you deploy your application to an Azure SQL Database backend! <a href="https://marlonribunal.com/getting-started-with-azure-sql-developer-on-macbook/">Continue reading <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a href="https://marlonribunal.com/getting-started-with-azure-sql-developer-on-macbook/">Getting Started with Azure SQL Developer on Macbook</a> first appeared on <a href="https://marlonribunal.com">SQL, Code, Coffee, Etc.</a>.</p>]]></description>
										<content:encoded><![CDATA[<p class="wp-block-paragraph">No, this is not the SQL Server Developer Edition. This is <strong>something new</strong> (as of the time of writing). Well, it&#8217;s like the Developer Edition that you&#8217;ve all been familiar with in all the SQL Server versions. This Developer edition is for the cloud-only, PaaS Azure SQL Database. And, yeah, we would like to thank Microsoft for this!</p>



<p class="wp-block-paragraph">The idea behind Azure SQL Developer is for anyone to build, iterate, and test locally at no cost. This means <strong>NO</strong> Azure subscription to deal with and <strong>NO</strong> credit card required! Everything will work seamlessly when you deploy your application to an Azure SQL Database backend!<br /><br />It&#8217;s exactly like the SQL Server Developer Edition that we all love. As of this writing, it&#8217;s in <strong>Private Preview</strong>. And I got the chance to get into the preview program. Find more information about it <a href="https://microsoft.github.io/azure-sql-database-container/">here</a>. There&#8217;s a short intro on youtube <a href="https://www.youtube.com/watch?v=eIkX-ypBkko">here</a>.</p>



<p class="wp-block-paragraph">I&#8217;d like to build something on top of Azure SQL Developer. But for now, let&#8217;s set it up on my dev environment:<br /><br />Laptop: <strong>Macbook Pro M5 Pro</strong><br />Code Editor: <strong>Zed 1.11.3</strong><br />Terminal: <strong>iTerm2</strong><br />Container App: <strong>OrbStack</strong> (my preferred container app on mac)<br />Database: Local <strong>Azure SQL Developer </strong>container<br />AI Coding Agent: <strong>Claude Code Max 5x</strong></p>



<p class="wp-block-paragraph">By the way, same steps should apply to Windows.</p>



<h2 class="wp-block-heading">Authenticate to the Preview Registry</h2>



<p class="wp-block-paragraph">Like I said, Azure SQL Developer is currently in Private Preview. I was given a user and password to authenticate to the registry to pull the latest image.</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#292d3e"><span style="background:#aaafcf;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#292d3e">Zsh</span></span><span role="button" tabindex="0" style="color:#babed8;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>docker login sqldbpreview-dpgaeqhmgphzd4bk.azurecr.io -u private-preview-reader</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki material-theme-palenight" style="background-color: #292D3E" tabindex="0"><code><span class="line"><span style="color: #FFCB6B">docker</span><span style="color: #BABED8"> </span><span style="color: #C3E88D">login</span><span style="color: #BABED8"> </span><span style="color: #C3E88D">sqldbpreview-dpgaeqhmgphzd4bk.azurecr.io</span><span style="color: #BABED8"> </span><span style="color: #C3E88D">-u</span><span style="color: #BABED8"> </span><span style="color: #C3E88D">private-preview-reader</span></span></code></pre></div>



<p class="wp-block-paragraph">Input the password that was sent to you when you get admitted to the private preview. Hopefully, pulling the image would be much more convenient when this goes public.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="738" src="https://marlonribunal.com/wp-content/uploads/2026/07/image-28-1024x738.png" alt="" class="wp-image-2804" srcset="https://marlonribunal.com/wp-content/uploads/2026/07/image-28-1024x738.png 1024w, https://marlonribunal.com/wp-content/uploads/2026/07/image-28-300x216.png 300w, https://marlonribunal.com/wp-content/uploads/2026/07/image-28-768x554.png 768w, https://marlonribunal.com/wp-content/uploads/2026/07/image-28-1536x1107.png 1536w, https://marlonribunal.com/wp-content/uploads/2026/07/image-28.png 1884w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">You should get a <code>Login Succeeded</code> message.</p>



<h2 class="wp-block-heading">Pull the Azure SQL Developer image and deploy container </h2>



<p class="wp-block-paragraph">Let&#8217;s pull the image and deploy the Azure SQL Developer container to OrbStack. </p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#292d3e"><span style="background:#aaafcf;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#292d3e">Zsh</span></span><span role="button" tabindex="0" style="color:#babed8;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>docker run --platform linux/amd64 -e ACCEPT_EULA=Y -e MSSQL_SA_PASSWORD='YourStrongPassword' -p 1433:1433 --name azuresqldb --hostname azuresqldb -d sqldbpreview-dpgaeqhmgphzd4bk.azurecr.io/azure-sql/db-dev:latest</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki material-theme-palenight" style="background-color: #292D3E" tabindex="0"><code><span class="line"><span style="color: #FFCB6B">docker</span><span style="color: #BABED8"> </span><span style="color: #C3E88D">run</span><span style="color: #BABED8"> </span><span style="color: #C3E88D">--platform</span><span style="color: #BABED8"> </span><span style="color: #C3E88D">linux/amd64</span><span style="color: #BABED8"> </span><span style="color: #C3E88D">-e</span><span style="color: #BABED8"> </span><span style="color: #C3E88D">ACCEPT_EULA=Y</span><span style="color: #BABED8"> </span><span style="color: #C3E88D">-e</span><span style="color: #BABED8"> </span><span style="color: #C3E88D">MSSQL_SA_PASSWORD=</span><span style="color: #89DDFF">&#39;</span><span style="color: #C3E88D">YourStrongPassword</span><span style="color: #89DDFF">&#39;</span><span style="color: #BABED8"> </span><span style="color: #C3E88D">-p</span><span style="color: #BABED8"> </span><span style="color: #F78C6C">1433</span><span style="color: #C3E88D">:1433</span><span style="color: #BABED8"> </span><span style="color: #C3E88D">--name</span><span style="color: #BABED8"> </span><span style="color: #C3E88D">azuresqldb</span><span style="color: #BABED8"> </span><span style="color: #C3E88D">--hostname</span><span style="color: #BABED8"> </span><span style="color: #C3E88D">azuresqldb</span><span style="color: #BABED8"> </span><span style="color: #C3E88D">-d</span><span style="color: #BABED8"> </span><span style="color: #C3E88D">sqldbpreview-dpgaeqhmgphzd4bk.azurecr.io/azure-sql/db-dev:latest</span></span></code></pre></div>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Normally, I would pull the image first then deploy. But you can also directly deploy and docker should be able to pull the image first (duh).<br /></p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="766" src="https://marlonribunal.com/wp-content/uploads/2026/07/image-29-1024x766.png" alt="" class="wp-image-2805" srcset="https://marlonribunal.com/wp-content/uploads/2026/07/image-29-1024x766.png 1024w, https://marlonribunal.com/wp-content/uploads/2026/07/image-29-300x225.png 300w, https://marlonribunal.com/wp-content/uploads/2026/07/image-29-768x575.png 768w, https://marlonribunal.com/wp-content/uploads/2026/07/image-29-1536x1150.png 1536w, https://marlonribunal.com/wp-content/uploads/2026/07/image-29.png 1884w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h2 class="wp-block-heading">Test connection to our local Azure Database Developer</h2>



<p class="wp-block-paragraph">Let&#8217;s send a query to the database to make sure we can establish a connection to it.</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#292d3e"><span style="background:#aaafcf;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#292d3e">Zsh</span></span><span role="button" tabindex="0" style="color:#babed8;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>docker exec azuresqldb /opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P 'YourStrongPassword' -C -Q 'SELECT @@VERSION;'</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki material-theme-palenight" style="background-color: #292D3E" tabindex="0"><code><span class="line"><span style="color: #FFCB6B">docker</span><span style="color: #BABED8"> </span><span style="color: #C3E88D">exec</span><span style="color: #BABED8"> </span><span style="color: #C3E88D">azuresqldb</span><span style="color: #BABED8"> </span><span style="color: #C3E88D">/opt/mssql-tools18/bin/sqlcmd</span><span style="color: #BABED8"> </span><span style="color: #C3E88D">-S</span><span style="color: #BABED8"> </span><span style="color: #C3E88D">localhost</span><span style="color: #BABED8"> </span><span style="color: #C3E88D">-U</span><span style="color: #BABED8"> </span><span style="color: #C3E88D">sa</span><span style="color: #BABED8"> </span><span style="color: #C3E88D">-P</span><span style="color: #BABED8"> </span><span style="color: #89DDFF">&#39;</span><span style="color: #C3E88D">YourStrongPassword</span><span style="color: #89DDFF">&#39;</span><span style="color: #BABED8"> </span><span style="color: #C3E88D">-C</span><span style="color: #BABED8"> </span><span style="color: #C3E88D">-Q</span><span style="color: #BABED8"> </span><span style="color: #89DDFF">&#39;</span><span style="color: #C3E88D">SELECT @@VERSION;</span><span style="color: #89DDFF">&#39;</span></span></code></pre></div>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">And if you&#8217;ve followed the steps correctly, you should now be able to connect to the local version of Azure SQL Database. </p>



<p class="wp-block-paragraph">As of this writing, as you can see in the screenshot below, the current version of Azure SQL Database Developer is <code>12.0.2000.8</code>, July 12, 2026</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="758" src="https://marlonribunal.com/wp-content/uploads/2026/07/image-30-1024x758.png" alt="" class="wp-image-2806" srcset="https://marlonribunal.com/wp-content/uploads/2026/07/image-30-1024x758.png 1024w, https://marlonribunal.com/wp-content/uploads/2026/07/image-30-300x222.png 300w, https://marlonribunal.com/wp-content/uploads/2026/07/image-30-768x568.png 768w, https://marlonribunal.com/wp-content/uploads/2026/07/image-30-1536x1137.png 1536w, https://marlonribunal.com/wp-content/uploads/2026/07/image-30.png 1884w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">Enjoy! I&#8217;ll build something on top of this. Come back for that later!</p>



<p class="wp-block-paragraph"></p><p>The post <a href="https://marlonribunal.com/getting-started-with-azure-sql-developer-on-macbook/">Getting Started with Azure SQL Developer on Macbook</a> first appeared on <a href="https://marlonribunal.com">SQL, Code, Coffee, Etc.</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://marlonribunal.com/getting-started-with-azure-sql-developer-on-macbook/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Restore SQL Server Database to an OrbStack Container</title>
		<link>https://marlonribunal.com/restore-sql-server-database-to-an-orbstack-container/</link>
					<comments>https://marlonribunal.com/restore-sql-server-database-to-an-orbstack-container/#respond</comments>
		
		<dc:creator><![CDATA[Marlon Ribunal]]></dc:creator>
		<pubDate>Mon, 20 Jul 2026 13:42:00 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<guid isPermaLink="false">https://marlonribunal.com/?p=2719</guid>

					<description><![CDATA[<p>In the previous post, we've built a SQL Server 2025 sandbox in an OrbStack container in a Macbook. If you are like me who switched from a Windows laptop to MacBook, you are probably missing your SQL Server. Sometimes it's just nice to have a sandbox that is separate from your all other instances for testing and learning. This is exactly what we're trying to do here. <a href="https://marlonribunal.com/restore-sql-server-database-to-an-orbstack-container/">Continue reading <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a href="https://marlonribunal.com/restore-sql-server-database-to-an-orbstack-container/">Restore SQL Server Database to an OrbStack Container</a> first appeared on <a href="https://marlonribunal.com">SQL, Code, Coffee, Etc.</a>.</p>]]></description>
										<content:encoded><![CDATA[<p class="wp-block-paragraph">In the previous post, we&#8217;ve built a SQL Server 2025 sandbox in an OrbStack container in a Macbook. If you are like me who switched from a Windows laptop to MacBook, you are probably missing your SQL Server. Sometimes it&#8217;s just nice to have a sandbox that is separate from your all other instances for testing and learning. This is exactly what we&#8217;re trying to do here.</p>



<h2 class="wp-block-heading">Download the Backup</h2>



<p class="wp-block-paragraph">For this exercise we want to download the full backup of Wide World Importers. Go ahead and download it from the github repo which you can find it <a href="https://github.com/Microsoft/sql-server-samples/releases/tag/wide-world-importers-v1.0" target="_blank" rel="noopener nofollow" title="Wide World Importers Sample Database">here</a>. And of course, take note of where you saved the .bak file. </p>



<h2 class="wp-block-heading">Copy the Backup File into the Container</h2>



<p class="wp-block-paragraph">First, let&#8217;s create our backup directory in our cotainer. From your favorite terminal, run the following:</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#292d3e"><span style="background:#aaafcf;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#292d3e">ShellScript</span></span><span role="button" tabindex="0" style="color:#babed8;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>docker exec -it sql2025 mkdir -p /var/opt/mssql/backup</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki material-theme-palenight" style="background-color: #292D3E" tabindex="0"><code><span class="line"><span style="color: #FFCB6B">docker</span><span style="color: #BABED8"> </span><span style="color: #C3E88D">exec</span><span style="color: #BABED8"> </span><span style="color: #C3E88D">-it</span><span style="color: #BABED8"> </span><span style="color: #C3E88D">sql2025</span><span style="color: #BABED8"> </span><span style="color: #C3E88D">mkdir</span><span style="color: #BABED8"> </span><span style="color: #C3E88D">-p</span><span style="color: #BABED8"> </span><span style="color: #C3E88D">/var/opt/mssql/backup</span></span></code></pre></div>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Then copy over the file to the directory we just created above</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#292d3e"><span style="background:#aaafcf;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#292d3e">ShellScript</span></span><span role="button" tabindex="0" style="color:#babed8;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>docker cp /Users/marlonribunal/Downloads/WideWorldImporters-Full.bak sql2025:/var/opt/mssql/backup/</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki material-theme-palenight" style="background-color: #292D3E" tabindex="0"><code><span class="line"><span style="color: #FFCB6B">docker</span><span style="color: #BABED8"> </span><span style="color: #C3E88D">cp</span><span style="color: #BABED8"> </span><span style="color: #C3E88D">/Users/marlonribunal/Downloads/WideWorldImporters-Full.bak</span><span style="color: #BABED8"> </span><span style="color: #C3E88D">sql2025:/var/opt/mssql/backup/</span></span></code></pre></div>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">You terminal should now say that the backup file was successfully copied.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="776" src="https://marlonribunal.com/wp-content/uploads/2026/07/image-16-1024x776.png" alt="" class="wp-image-2721" srcset="https://marlonribunal.com/wp-content/uploads/2026/07/image-16-1024x776.png 1024w, https://marlonribunal.com/wp-content/uploads/2026/07/image-16-300x227.png 300w, https://marlonribunal.com/wp-content/uploads/2026/07/image-16-768x582.png 768w, https://marlonribunal.com/wp-content/uploads/2026/07/image-16-1536x1164.png 1536w, https://marlonribunal.com/wp-content/uploads/2026/07/image-16.png 1844w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h2 class="wp-block-heading">Use VS Code to Restore the Database</h2>



<p class="wp-block-paragraph">Since Microsoft will never ever port SSMS to the macOS, I think VS Code with the mssql extension is a pretty much decent tool for doing work in a SQL Server.</p>



<p class="wp-block-paragraph">Check the in-memory data, database, and log files contained in the backup, so we know what logical files to map to their physical paths in the container:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers cbp-highlight-hover" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#babed8;--cbp-line-number-width:calc(1 * 0.6 * .875rem);--cbp-line-highlight-color:rgba(159, 170, 243, 0.2);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#292d3e"><span style="background:#aaafcf;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#292d3e">SQL</span></span><span role="button" tabindex="0" style="color:#babed8;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>RESTORE FILELISTONLY
FROM DISK = N'/var/opt/mssql/backup/WideWorldImporters-Full.bak';
GO</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki material-theme-palenight" style="background-color: #292D3E" tabindex="0"><code><span class="line"><span style="color: #F78C6C">RESTORE</span><span style="color: #BABED8"> </span><span style="color: #F78C6C">FILELISTONLY</span></span>
<span class="line"><span style="color: #F78C6C">FROM</span><span style="color: #BABED8"> </span><span style="color: #F78C6C">DISK</span><span style="color: #BABED8"> </span><span style="color: #89DDFF">=</span><span style="color: #BABED8"> </span><span style="color: #C3E88D">N</span><span style="color: #89DDFF">&#39;</span><span style="color: #C3E88D">/var/opt/mssql/backup/WideWorldImporters-Full.bak</span><span style="color: #89DDFF">&#39;</span><span style="color: #BABED8">;</span></span>
<span class="line"><span style="color: #F78C6C">GO</span></span></code></pre></div>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">You should see all the contained in the backup file of the <code>WideWorldImporters</code> database. Take note of those for the next step.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="582" src="https://marlonribunal.com/wp-content/uploads/2026/07/image-17-1024x582.png" alt="" class="wp-image-2722" srcset="https://marlonribunal.com/wp-content/uploads/2026/07/image-17-1024x582.png 1024w, https://marlonribunal.com/wp-content/uploads/2026/07/image-17-300x170.png 300w, https://marlonribunal.com/wp-content/uploads/2026/07/image-17-768x436.png 768w, https://marlonribunal.com/wp-content/uploads/2026/07/image-17-1536x872.png 1536w, https://marlonribunal.com/wp-content/uploads/2026/07/image-17-scaled.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Then restore the database. Please take note that if you don&#8217;t map the path of the files to where you want to store them, the restore proccess will assume that you are restoring the files into the same directory the backup files were stored in the source. Chances are you will then get an error because those original directory don&#8217;t exist in the target container.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers cbp-highlight-hover" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#babed8;--cbp-line-number-width:calc(1 * 0.6 * .875rem);--cbp-line-highlight-color:rgba(159, 170, 243, 0.2);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#292d3e"><span style="background:#aaafcf;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#292d3e">SQL</span></span><span role="button" tabindex="0" style="color:#babed8;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>RESTORE DATABASE &#91;WideWorldImporters&#93;
FROM DISK = '/var/opt/mssql/backup/WideWorldImporters-Full.bak'
WITH 
MOVE 'WWI_Primary' TO '/var/opt/mssql/data/WideWorldImporters.mdf',
MOVE 'WWI_UserData' TO '/var/opt/mssql/data/WideWorldImporters_UserData.ndf',
MOVE 'WWI_Log' TO '/var/opt/mssql/data/WideWorldImporters_Log.ldf',
MOVE 'WWI_InMemory_Data_1' TO '/var/opt/mssql/data/WideWorldImporters_InMemory_Data_1',
REPLACE;
GO</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki material-theme-palenight" style="background-color: #292D3E" tabindex="0"><code><span class="line"><span style="color: #F78C6C">RESTORE</span><span style="color: #BABED8"> </span><span style="color: #F78C6C">DATABASE</span><span style="color: #BABED8"> &#91;WideWorldImporters&#93;</span></span>
<span class="line"><span style="color: #F78C6C">FROM</span><span style="color: #BABED8"> </span><span style="color: #F78C6C">DISK</span><span style="color: #BABED8"> </span><span style="color: #89DDFF">=</span><span style="color: #BABED8"> </span><span style="color: #89DDFF">&#39;</span><span style="color: #C3E88D">/var/opt/mssql/backup/WideWorldImporters-Full.bak</span><span style="color: #89DDFF">&#39;</span></span>
<span class="line"><span style="color: #F78C6C">WITH</span><span style="color: #BABED8"> </span></span>
<span class="line"><span style="color: #F78C6C">MOVE</span><span style="color: #BABED8"> </span><span style="color: #89DDFF">&#39;</span><span style="color: #C3E88D">WWI_Primary</span><span style="color: #89DDFF">&#39;</span><span style="color: #BABED8"> </span><span style="color: #F78C6C">TO</span><span style="color: #BABED8"> </span><span style="color: #89DDFF">&#39;</span><span style="color: #C3E88D">/var/opt/mssql/data/WideWorldImporters.mdf</span><span style="color: #89DDFF">&#39;</span><span style="color: #BABED8">,</span></span>
<span class="line"><span style="color: #F78C6C">MOVE</span><span style="color: #BABED8"> </span><span style="color: #89DDFF">&#39;</span><span style="color: #C3E88D">WWI_UserData</span><span style="color: #89DDFF">&#39;</span><span style="color: #BABED8"> </span><span style="color: #F78C6C">TO</span><span style="color: #BABED8"> </span><span style="color: #89DDFF">&#39;</span><span style="color: #C3E88D">/var/opt/mssql/data/WideWorldImporters_UserData.ndf</span><span style="color: #89DDFF">&#39;</span><span style="color: #BABED8">,</span></span>
<span class="line"><span style="color: #F78C6C">MOVE</span><span style="color: #BABED8"> </span><span style="color: #89DDFF">&#39;</span><span style="color: #C3E88D">WWI_Log</span><span style="color: #89DDFF">&#39;</span><span style="color: #BABED8"> </span><span style="color: #F78C6C">TO</span><span style="color: #BABED8"> </span><span style="color: #89DDFF">&#39;</span><span style="color: #C3E88D">/var/opt/mssql/data/WideWorldImporters_Log.ldf</span><span style="color: #89DDFF">&#39;</span><span style="color: #BABED8">,</span></span>
<span class="line"><span style="color: #F78C6C">MOVE</span><span style="color: #BABED8"> </span><span style="color: #89DDFF">&#39;</span><span style="color: #C3E88D">WWI_InMemory_Data_1</span><span style="color: #89DDFF">&#39;</span><span style="color: #BABED8"> </span><span style="color: #F78C6C">TO</span><span style="color: #BABED8"> </span><span style="color: #89DDFF">&#39;</span><span style="color: #C3E88D">/var/opt/mssql/data/WideWorldImporters_InMemory_Data_1</span><span style="color: #89DDFF">&#39;</span><span style="color: #BABED8">,</span></span>
<span class="line"><span style="color: #F78C6C">REPLACE</span><span style="color: #BABED8">;</span></span>
<span class="line"><span style="color: #F78C6C">GO</span></span></code></pre></div>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">That took about 8 seconds to complete in my container:<br /></p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="643" src="https://marlonribunal.com/wp-content/uploads/2026/07/image-18-1024x643.png" alt="" class="wp-image-2723" srcset="https://marlonribunal.com/wp-content/uploads/2026/07/image-18-1024x643.png 1024w, https://marlonribunal.com/wp-content/uploads/2026/07/image-18-300x188.png 300w, https://marlonribunal.com/wp-content/uploads/2026/07/image-18-768x483.png 768w, https://marlonribunal.com/wp-content/uploads/2026/07/image-18-1536x965.png 1536w, https://marlonribunal.com/wp-content/uploads/2026/07/image-18-scaled.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">That&#8217;s it! Enjoy querying!</p><p>The post <a href="https://marlonribunal.com/restore-sql-server-database-to-an-orbstack-container/">Restore SQL Server Database to an OrbStack Container</a> first appeared on <a href="https://marlonribunal.com">SQL, Code, Coffee, Etc.</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://marlonribunal.com/restore-sql-server-database-to-an-orbstack-container/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>