<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Databases on Matt Thornton</title>
    <link>https://matt-thornton.net/tags/databases/</link>
    <description>Recent content in Databases on Matt Thornton</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Fri, 12 Oct 2018 15:37:14 +0000</lastBuildDate><atom:link href="https://matt-thornton.net/tags/databases/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>SQL Server - quickly delete all tables</title>
      <link>https://matt-thornton.net/tech/databases/sql-server-quickly-delete-all-tables/</link>
      <pubDate>Fri, 12 Oct 2018 15:37:14 +0000</pubDate>
      
      <guid>https://matt-thornton.net/tech/databases/sql-server-quickly-delete-all-tables/</guid>
      
        <description>&lt;p&gt;With most things in SQL Server it&amp;rsquo;s tempting to think you can script it. Because most of the time you can.&lt;/p&gt;
&lt;p&gt;Recently, I had a requirement to quickly drop everything out of a database (but without actually just dropping the whole database.)&lt;/p&gt;
&lt;p&gt;The best option I found, was:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;In the database tree view, find the container for the type of objects you want to delete (e.g., tables)&lt;/li&gt;
&lt;li&gt;Press F7 to open up the Object Explorer&lt;/li&gt;
&lt;li&gt;From here, select all the items you want to delete. Press delete.&lt;/li&gt;
&lt;li&gt;This opens up the standard ‘drop item&amp;rsquo; dialog, but with all those objects included.&lt;/li&gt;
&lt;li&gt;Hit OK&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;And boom, away it goes. You can repeat this for any database objects by navigating around the Object Explorer. If you wanted to script this, you&amp;rsquo;d need to (probably) start navigating the master database and get some cursors and whatnot going on.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>MySQL on Raspberry Pi - allow connections from non-localhost</title>
      <link>https://matt-thornton.net/tech/databases/mysql-raspberry-pi-allow-connections-non-localhost/</link>
      <pubDate>Wed, 06 Dec 2017 05:21:05 +0000</pubDate>
      
      <guid>https://matt-thornton.net/tech/databases/mysql-raspberry-pi-allow-connections-non-localhost/</guid>
      
        <description>&lt;p&gt;If you want to connect to MySQL from any device in your network that isn&amp;rsquo;t on localhost, then you may encounter an error:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;MySQL error: Could not connect to any of the specified hosts&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Bear in mind that e.g., a PHP web app or phpmyadmin will continue to work, since (assuming your web server such as Apache is running on the same server as MySQL) they&amp;rsquo;re technically running on localhost and will be able to connect.&lt;/p&gt;</description>
      
    </item>
    
  </channel>
</rss>