<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
    <channel>
        
        <title>
            <![CDATA[ mssql - freeCodeCamp.org ]]>
        </title>
        <description>
            <![CDATA[ Browse thousands of programming tutorials written by experts. Learn Web Development, Data Science, DevOps, Security, and get developer career advice. ]]>
        </description>
        <link>https://www.freecodecamp.org/news/</link>
        <image>
            <url>https://cdn.freecodecamp.org/universal/favicons/favicon.png</url>
            <title>
                <![CDATA[ mssql - freeCodeCamp.org ]]>
            </title>
            <link>https://www.freecodecamp.org/news/</link>
        </image>
        <generator>Eleventy</generator>
        <lastBuildDate>Thu, 28 May 2026 20:57:41 +0000</lastBuildDate>
        <atom:link href="https://www.freecodecamp.org/news/tag/mssql-2/rss.xml" rel="self" type="application/rss+xml" />
        <ttl>60</ttl>
        
            <item>
                <title>
                    <![CDATA[ How to Import a Sample Database to your AWS RDS Microsoft SQL Server using S3 ]]>
                </title>
                <description>
                    <![CDATA[ By Clark Jason Ngo This guide was created because it was so hard to find a way to play around with a sample database using AWS RDS MSSQL Server. I hope you find this helpful. If you haven't set up your AWS RDS Microsoft SQL Server and Azure Data Stud... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/cjn-how-to-import-a-sample-database-to-your-aws-rds-microsoft-sql-server-using-s3/</link>
                <guid isPermaLink="false">66d45e0e3dce891ac3a967de</guid>
                
                    <category>
                        <![CDATA[ mssql ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Azure ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Backup ]]>
                    </category>
                
                    <category>
                        <![CDATA[ database ]]>
                    </category>
                
                    <category>
                        <![CDATA[ S3 ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Sun, 29 Mar 2020 10:13:35 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2020/03/Screen-Shot-2020-03-29-at-3.12.23-AM.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Clark Jason Ngo</p>
<p>This guide was created because it was so hard to find a way to play around with a sample database using AWS RDS MSSQL Server. I hope you find this helpful.</p>
<p>If you haven't set up your AWS RDS Microsoft SQL Server and Azure Data Studio, check this guide first: <em><a target="_blank" href="https://www.freecodecamp.org/news/cjn-how-to-connect-your-aws-rds-microsoft-sql-server-using-azure-data-studio/">How to Connect your AWS RDS Microsoft SQL Server using Azure Data Studio</a></em>.</p>
<p>We will be touching the technologies shown below:  </p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-244.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ul>
<li>Database: AWS RDS Microsoft SQL Server Express Edition</li>
<li>Database tool and GUI: Azure Data Studio</li>
<li>Sample database backup copy: Amazon S3 Bucket</li>
</ul>
<h2 id="heading-adventureworks-sample-database-backup-copy">AdventureWorks sample database backup copy</h2>
<p>To get the OLTP downloads of AdventureWorks, go to this <a target="_blank" href="https://docs.microsoft.com/en-us/sql/samples/adventureworks-install-configure?view=sql-server-ver15">link</a> and choose any sample database. In my example, I choose <code>AdventureWorks2017.bak</code>. We will upload this to the S3 Bucket.</p>
<h2 id="heading-amazon-s3-bucket">Amazon S3 Bucket</h2>
<h3 id="heading-creating-the-s3-bucket">Creating the S3 Bucket</h3>
<ol>
<li>Create a bucket. You can choose any bucket name (example: yourname-sample-dbs).</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-202.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ol start="2">
<li>Make sure the region is same as the AWS RDS instance. </li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-203.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ol start="3">
<li><p>Tick the following checkboxes:</p>
</li>
<li><p>Block public access to buckets and objects granted through <em>new</em> access control lists (ACLs)</p>
</li>
<li>Block public access and objects granted through <em>any</em> access control lists (ACLs)</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-204.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ol start="4">
<li>Access your bucket again by clicking on your created bucket.</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-205.png" alt="Image" width="600" height="400" loading="lazy"></p>
<h3 id="heading-uploading-the-file-to-the-s3-bucket">Uploading the file to the S3 bucket</h3>
<ol>
<li>Click <strong>Upload</strong>.</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-206.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ol start="2">
<li>Choose the database backup file. For example: <code>AdventureWorks2017.bak</code>. Keep choosing <strong>Next</strong> and choose <strong>Upload</strong> at the Review section.</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-207.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ol start="3">
<li>Update your Bucket Policy to allow access to your S3 Bucket. Note that your ARN will differ to mine. Hit <strong>Save</strong> afterwards.</li>
</ol>
<pre><code class="lang-json">{
    <span class="hljs-attr">"Version"</span>: <span class="hljs-string">"2012-10-17"</span>,
    <span class="hljs-attr">"Id"</span>: <span class="hljs-string">"Policy1548223592786"</span>,
    <span class="hljs-attr">"Statement"</span>: [
        {
            <span class="hljs-attr">"Sid"</span>: <span class="hljs-string">"Stmt1548223591553"</span>,
            <span class="hljs-attr">"Effect"</span>: <span class="hljs-string">"Allow"</span>,
            <span class="hljs-attr">"Principal"</span>: <span class="hljs-string">"*"</span>,
            <span class="hljs-attr">"Action"</span>: <span class="hljs-string">"s3:GetObject"</span>,
            <span class="hljs-attr">"Resource"</span>: <span class="hljs-string">"arn:aws:s3:::changethis/*"</span>
        }
    ]
}
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-208.png" alt="Image" width="600" height="400" loading="lazy"></p>
<h2 id="heading-aws-rds-mssql-server-express">AWS RDS - MSSQL Server Express</h2>
<h3 id="heading-creating-an-option-group-for-your-rds-instance">Creating an Option Group for your RDS instance</h3>
<ol>
<li>Click <strong>Option groups</strong>,</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-194.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ol start="2">
<li>Create an option group. Choose any name and description. For the Engine, it should match your RDS instance. In my example, I used SQL Server Express Edition so I choose <code>sqlserver-ex</code>.</li>
</ol>
<p>Here are the following Engines and their abbreviations:</p>
<ul>
<li>SQL Server Enterprise Edition: <code>sqlserver-ee</code></li>
<li>SQL Server Standard Edition: <code>sqlserver-se</code></li>
<li>SQL Server Web Edition: <code>sqlserver-web</code></li>
<li>SQL Server Express Edition: <code>sqlserver-ex</code></li>
</ul>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-195.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ol start="3">
<li>Once you have created the option group, you'll need to <strong>Add option</strong>.</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-199.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ol start="4">
<li>Choose <strong>SQLSERVER_BACKUP_RESTORE</strong> for your Option name. For the IAM role, it is best to create a new role.</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-200.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ol start="5">
<li>Choose the S3 bucket where your database file is hosted. For scheduling, choose <strong>Immediately</strong>.</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-201.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ol start="6">
<li>Go back to your AWS RDS MSSQL Server instance and click <strong>Modify</strong>.</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-196.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ol start="7">
<li>Choose the created option group with <code>sql-server-express-backup</code>, then Click Continue.</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-197.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ol start="8">
<li>Choose to <strong>Apply immediately</strong> for scheduling of modifications. </li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-198.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ol start="9">
<li>Go back to your AWS RDS MSSQL Server instance page and scroll down and modify <em>Manage IAM Roles</em>. Add the IAM role you have created in S3. For the Feature, choose <strong>S3_INTEGRATION</strong>. </li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-210.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-211.png" alt="Image" width="600" height="400" loading="lazy"></p>
<h2 id="heading-azure-data-studio">Azure Data Studio</h2>
<h3 id="heading-importing-the-sample-database-in-s3-bucket-through-restore-function">Importing the sample database in S3 bucket through restore function</h3>
<ol>
<li>In your connected AWS RDS MSSQL Server, create a new query and type in the following:</li>
</ol>
<pre><code class="lang-sql">exec msdb.dbo.rds_restore_database 
@restore_db_name='AdventureWorks-test', 
@s3_arn_to_restore_from='arn:aws:s3:::clark-sample-dbs/AdventureWorks2017.bak';
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-209.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Refresh your Azure Data Studio. Also, try restarting the application if your database did not appear or don't have permission to access it.</p>
<p>Now you are done! Good job! ???</p>
<p>Resources:</p>
<ul>
<li><a target="_blank" href="https://aws.amazon.com/premiumsupport/knowledge-center/native-backup-rds-sql-server/">https://aws.amazon.com/premiumsupport/knowledge-center/native-backup-rds-sql-server/</a></li>
</ul>
<p>Connect with me on LinkedIn <a target="_blank" href="https://www.linkedin.com/in/clarkngo/">here</a></p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-243.png" alt="Image" width="600" height="400" loading="lazy"></p>
 ]]>
                </content:encoded>
            </item>
        
    </channel>
</rss>
