<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-AU" xmlns:media="http://search.yahoo.com/mrss/">
  <id>https://david.gardiner.net.au/tags/SQL.xml</id>
  <title type="html">David Gardiner - SQL</title>
  <updated>2026-04-17T00:25:05.163Z</updated>
  <subtitle>Blog posts tagged with &apos;SQL&apos; - A blog of software development, .NET and other interesting things</subtitle>
  <rights>Copyright 2026 David Gardiner</rights>
  <icon>https://www.gravatar.com/avatar/37edf2567185071646d62ba28b868fab?s=64</icon>
  <logo>https://www.gravatar.com/avatar/37edf2567185071646d62ba28b868fab?s=256</logo>
  <generator uri="https://github.com/flcdrg/astrojs-atom" version="3">astrojs-atom</generator>
  <author>
    <name>David Gardiner</name>
  </author>
  <link href="https://david.gardiner.net.au/tags/SQL.xml" rel="self" type="application/atom+xml"/>
  <link href="https://david.gardiner.net.au/tags/SQL" rel="alternate" type="text/html" hreflang="en-AU"/>
  <category term="SQL"/>
  <category term="Software Development"/>
  <entry>
    <id>https://david.gardiner.net.au/2025/02/azure-sql-auditing</id>
    <updated>2025-02-17T08:00:00.000+10:30</updated>
    <title>Azure SQL and enabling auditing with Terraform</title>
    <link href="https://david.gardiner.net.au/2025/02/azure-sql-auditing" rel="alternate" type="text/html" title="Azure SQL and enabling auditing with Terraform"/>
    <category term="Azure"/>
    <category term="SQL"/>
    <category term="Terraform"/>
    <published>2025-02-17T08:00:00.000+10:30</published>
    <summary type="html">Sometimes when you&apos;re using Terraform for your Infrastructure as Code with Azure, it&apos;s a bit tricky to match up what you can see in the Azure Portal versus the Terraform resources in the AzureRM provider. Enabling auditing in Azure SQL is a great example.</summary>
    <content type="html">&lt;p&gt;&lt;img src=&quot;https://david.gardiner.net.au/_astro/azure-logo.BF5E_tzp_16YqLd.webp&quot; alt=&quot;Azure logo&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Sometimes when you&apos;re using Terraform for your Infrastructure as Code with Azure, it&apos;s a bit tricky to match up what you can see in the Azure Portal versus the Terraform resources in the AzureRM provider. Enabling auditing in Azure SQL is a great example.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://david.gardiner.net.au/_astro/azure-sql-auditing-enabled-only.DmeJYD5Y_Z1UPn40.webp&quot; alt=&quot;Screenshot of Azure SQL Auditing portal page, showing auditing enabled, but no data stores selected&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In the Azure Portal, select your Azure SQL resource, then expand the &lt;strong&gt;Security&lt;/strong&gt; menu and select &lt;strong&gt;Auditing&lt;/strong&gt;. You can then choose to &lt;strong&gt;Enable Azure SQL Auditing&lt;/strong&gt;, and upon doing this you can then choose to send auditing data to any or all of Azure Storage, Log Analytics and/or Event Hub.&lt;/p&gt;
&lt;p&gt;It&apos;s also worth highlighting that usually you&apos;d &lt;a href=&quot;https://learn.microsoft.com/azure/azure-sql/database/auditing-server-level-database-level?view=azuresql&amp;amp;WT.mc_id=DOP-MVP-5001655&quot;&gt;enable auditing at the server level&lt;/a&gt;, but it is also possible to enable it per database.&lt;/p&gt;
&lt;p&gt;The two Terraform resources you may have encountered to manage this are &lt;a href=&quot;https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/mssql_server_extended_auditing_policy&quot;&gt;&lt;code&gt;mssql_server_extended_auditing_policy&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/mssql_database_extended_auditing_policy&quot;&gt;&lt;code&gt;mssql_database_extended_auditing_policy&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;It&apos;s useful to refer back to the &lt;a href=&quot;https://learn.microsoft.com/azure/azure-sql/database/auditing-setup?view=azuresql&amp;amp;WT.mc_id=DOP-MVP-5001655&quot;&gt;Azure SQL documentation on setting up auditing&lt;/a&gt; to understand how to use these.&lt;/p&gt;
&lt;p&gt;A couple of points that are worth highlighting:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;p&gt;If you don&apos;t use the &lt;code&gt;audit_actions_and_groups&lt;/code&gt; property, the default groups of actions that will be audited are:&lt;/p&gt;
&lt;p&gt; BATCH_COMPLETED_GROUP
 SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP
 FAILED_DATABASE_AUTHENTICATION_GROUP&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If you do define auditing at the server level, the policy applies to all existing and newly created databases on the server. If you define auditing at the database level, the policy will apply in addition to any server level settings. So be careful you don&apos;t end up auditing the same thing twice unintentionally!&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Sometimes it can also be useful to review equivalent the Bicep/ARM definitions &lt;a href=&quot;https://learn.microsoft.com/azure/templates/microsoft.sql/servers/extendedauditingsettings?pivots=deployment-language-bicep&amp;amp;WT.mc_id=DOP-MVP-5001655&quot;&gt;Microsoft.Sql/servers/extendedAuditingSettings&lt;/a&gt;, as sometimes they can clarify how to use various properties.&lt;/p&gt;
&lt;p&gt;You&apos;ll see both the Terraform and Bicep have properties to configure using a Storage Account, but while you can see Log Analytics and Event Hub in the Portal UI, it&apos;s not obvious how those set up.&lt;/p&gt;
&lt;p&gt;The simplest policy you can set is this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;resource &quot;azurerm_mssql_server_extended_auditing_policy&quot; &quot;auditing&quot; {
  server_id = azurerm_mssql_server.mssql.id
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This enables the server auditing policy, but the data isn&apos;t going anywhere yet!&lt;/p&gt;
&lt;h2&gt;Storage account&lt;/h2&gt;
&lt;p&gt;When you select an Azure Storage Account for storing auditing data, you will end up with a bunch &lt;code&gt;.xel&lt;/code&gt; files created under a &lt;strong&gt;sqldbauditlogs&lt;/strong&gt; blob container.&lt;/p&gt;
&lt;p&gt;There are a number of ways to view the &lt;code&gt;.xel&lt;/code&gt; files, &lt;a href=&quot;https://learn.microsoft.com/azure/azure-sql/database/auditing-analyze-audit-logs?view=azuresql&amp;amp;WT.mc_id=DOP-MVP-5001655#analyze-logs-using-logs-in-an-azure-storage-account&quot;&gt;documented here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Using a storage account for storing auditing has a few variations, depending on how you want to authenticate to the Storage Account.&lt;/p&gt;
&lt;h3&gt;Access key&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;resource &quot;azurerm_mssql_server_extended_auditing_policy&quot; &quot;auditing&quot; {
  server_id = azurerm_mssql_server.mssql.id

  storage_endpoint                        = azurerm_storage_account.storage.primary_blob_endpoint
  storage_account_access_key              = azurerm_storage_account.storage.primary_access_key
  storage_account_access_key_is_secondary = false
  retention_in_days                       = 6
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Normally &lt;code&gt;storage_account_access_key_is_secondary&lt;/code&gt; would be set to &lt;code&gt;false&lt;/code&gt;, but if you are rotating your storage access keys, then you may choose to switch to the secondary key while you&apos;re rotating the primary.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://david.gardiner.net.au/_astro/azure-sql-auditing-storage-access-keys.oEcgse7T_Z153SPc.webp&quot; alt=&quot;Azure Portal showing Azure Storage Account with access key authentication&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Managed identity&lt;/h3&gt;
&lt;p&gt;You can also use managed identity to authenticate to the storage account. In this case you don&apos;t supply the access_key properties, but you will need to add a role assignment granting the &lt;strong&gt;Storage Blob Data Contributor&lt;/strong&gt; role to the identity of your Azure SQL resource.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;resource &quot;azurerm_mssql_server_extended_auditing_policy&quot; &quot;auditing&quot; {
  server_id = azurerm_mssql_server.mssql.id

  storage_endpoint  = azurerm_storage_account.storage.primary_blob_endpoint
  retention_in_days = 6
}
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Log analytics workspaces&lt;/h2&gt;
&lt;p&gt;To send data to a Log Analytics Workspace, the &lt;code&gt;log_monitoring_enabled&lt;/code&gt; property needs to be set to &lt;code&gt;true&lt;/code&gt;. This is the default.&lt;/p&gt;
&lt;p&gt;But to tell it &lt;em&gt;which&lt;/em&gt; workspace to send the data to, you need to add a &lt;a href=&quot;https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/monitor_diagnostic_setting&quot;&gt;&lt;code&gt;azurerm_monitor_diagnostic_setting&lt;/code&gt;&lt;/a&gt; resource.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;resource &quot;azurerm_monitor_diagnostic_setting&quot; &quot;mssql_server_to_log_analytics&quot; {
  name                       = &quot;example-diagnostic-setting&quot;
  target_resource_id         = &quot;${azurerm_mssql_server.mssql.id}/databases/master&quot;
  log_analytics_workspace_id = azurerm_log_analytics_workspace.la.id

  enabled_log {
    category = &quot;SQLSecurityAuditEvents&quot;
  }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://david.gardiner.net.au/_astro/azure-sql-auditing-log-analytics.DD3OzwDe_J6rzG.webp&quot; alt=&quot;Screenshot of Log Analytics destination from the Azure Portal&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Note that for the server policy, you set the &lt;code&gt;target_resource_id&lt;/code&gt; to the master database of the server, not the resource id of the server itself.&lt;/p&gt;
&lt;p&gt;Here&apos;s what the auditing data looks like when viewed in Log Analytics:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://david.gardiner.net.au/_astro/azure-sql-auditing-view-log-analytics.yKPixQWS_Kj21d.webp&quot; alt=&quot;Screenshot of viewing audit details in Log Analytics&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Event Hub&lt;/h2&gt;
&lt;p&gt;Likewise, if you want data to go to an Event Hub, you need to use the &lt;code&gt;azurerm_monitor_diagnostic_setting&lt;/code&gt; resource.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;resource &quot;azurerm_monitor_diagnostic_setting&quot; &quot;mssql_server_to_event_hub&quot; {
  name                           = &quot;ds_mssql_event_hub&quot;
  target_resource_id             = &quot;${azurerm_mssql_server.mssql.id}/databases/master&quot;
  eventhub_authorization_rule_id = azurerm_eventhub_namespace_authorization_rule.eh.id
  eventhub_name                  = azurerm_eventhub.eh.name

  enabled_log {
    category = &quot;SQLSecurityAuditEvents&quot;
  }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://david.gardiner.net.au/_astro/azure-sql-auditing-event-hub.BXc3xPm7_1JBNoa.webp&quot; alt=&quot;Screenshot showing Event Hub destination in the Azure Portal&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Multiple destinations&lt;/h2&gt;
&lt;p&gt;As is implied by the Azure Portal, you can have one, two or all three destinations enabled for auditing. But it isn&apos;t immediately obvious that you should only have one &lt;code&gt;azurerm_monitor_diagnostic_setting&lt;/code&gt; for your server auditing - don&apos;t create separate &lt;code&gt;azurerm_monitor_diagnostic_setting&lt;/code&gt; resources for each destination - Azure will not allow it.&lt;/p&gt;
&lt;p&gt;For example, if you&apos;re going to log to all three, you&apos;d have a single diagnostic resource like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;resource &quot;azurerm_monitor_diagnostic_setting&quot; &quot;mssql_server&quot; {
  name                           = &quot;diagnostic_setting&quot;
  target_resource_id             = &quot;${azurerm_mssql_server.mssql.id}/databases/master&quot;
  eventhub_authorization_rule_id = azurerm_eventhub_namespace_authorization_rule.eh.id
  eventhub_name                  = azurerm_eventhub.eh.name

  log_analytics_workspace_id     = azurerm_log_analytics_workspace.la.id
  log_analytics_destination_type = &quot;Dedicated&quot;

  enabled_log {
    category = &quot;SQLSecurityAuditEvents&quot;
  }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Note, this Terraform resource does have a &lt;code&gt;storage_account_id&lt;/code&gt; property, but this doesn&apos;t seem to be necessary as storage is configured via the &lt;code&gt;azurerm_mssql_server_extended_auditing_policy&lt;/code&gt; resource.&lt;/p&gt;
&lt;p&gt;You would need separate &lt;code&gt;azurerm_monitor_diagnostic_setting&lt;/code&gt; resources if you were configuring auditing per database though.&lt;/p&gt;
&lt;h2&gt;Common problems&lt;/h2&gt;
&lt;h3&gt;The diagnostic setting can&apos;t find the master database&lt;/h3&gt;
&lt;p&gt;Error: creating Monitor Diagnostics Setting &quot;diagnostic_setting&quot; for Resource &quot;/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-terraform-sql-auditing-australiaeast/providers/Microsoft.Sql/servers/sql-terraform-sql-auditing-australiaeast/databases/master&quot;: unexpected status 404 (404 Not Found) with error: ResourceNotFound: The Resource &apos;Microsoft.Sql/servers/sql-terraform-sql-auditing-australiaeast/databases/master&apos; under resource group &apos;rg-terraform-sql-auditing-australiaeast&apos; was not found. For more details please go to &lt;a href=&quot;https://aka.ms/ARMResourceNotFoundFix&quot;&gt;https://aka.ms/ARMResourceNotFoundFix&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It appears that &lt;a href=&quot;https://github.com/hashicorp/terraform-provider-azurerm/issues/22226&quot;&gt;sometimes the &lt;code&gt;azurerm_mssql_server&lt;/code&gt; resource reports it is created, but the master database is not yet ready&lt;/a&gt;. The workaround is to add a dependency on another database resource - as by definition the master database must exist before any other user databases can be created.&lt;/p&gt;
&lt;h3&gt;Diagnostic setting fails to update with 409 Conflict&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/hashicorp/terraform-provider-azurerm/issues/21161&quot;&gt;This error seems to happen to me when I try and set up Storage, Event Hubs and Log Analytics at the same time&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Error: creating Monitor Diagnostics Setting &quot;diagnostic_setting&quot; for Resource &quot;/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-terraform-sql-auditing-australiaeast/providers/Microsoft.Sql/servers/sql-terraform-sql-auditing-australiaeast/databases/master&quot;: unexpected status 409 (409 Conflict) with response: {&quot;code&quot;:&quot;Conflict&quot;,&quot;message&quot;:&quot;Data sink &apos;/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-terraform-sql-auditing-australiaeast/providers/Microsoft.EventHub/namespaces/evhns-terraform-sql-auditing-australiaeast/authorizationRules/evhar-terraform-sql-auditing-australiaeast&apos; is already used in diagnostic setting &apos;SQLSecurityAuditEvents_3d229c42-c7e7-4c97-9a99-ec0d0d8b86c1&apos; for category &apos;SQLSecurityAuditEvents&apos;. Data sinks can&apos;t be reused in different settings on the same category for the same resource.&quot;}&lt;/p&gt;
&lt;p&gt;After a lot of trial and error, I&apos;ve found the solution is to add a &lt;code&gt;depends_on&lt;/code&gt; block in your &lt;code&gt;azurerm_mssql_server_extended_auditing_policy&lt;/code&gt; resource, so that the &lt;code&gt;azurerm_monitor_diagnostic_setting&lt;/code&gt; is created first. (This feels like a bug in the Terraform AzureRM provider)&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;resource &quot;azurerm_mssql_server_extended_auditing_policy&quot; &quot;auditing&quot; {
  server_id = azurerm_mssql_server.mssql.id

  storage_endpoint  = azurerm_storage_account.storage.primary_blob_endpoint
  retention_in_days = 6

  depends_on = [azurerm_monitor_diagnostic_setting.mssql_server]
}
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Switching from Storage access keys to managed identity has no effect&lt;/h3&gt;
&lt;p&gt;Removing the storage access key properties from &lt;code&gt;azurerm_mssql_server_extended_auditing_policy&lt;/code&gt; doesn&apos;t currently switch the authentication to managed identity. The problem may relate to the &lt;code&gt;storage_account_subscription_id&lt;/code&gt; property. This is an optional property and while you usually don&apos;t need to set it if the storage account is in the same subscription, it appears that the AzureRM provider is setting it on your behalf, such that when you remove the other access key properties it doesn&apos;t know to set this property to null.&lt;/p&gt;
&lt;p&gt;If you know ahead of time that you&apos;ll be transitioning from access keys to managed identity, it might be worth setting &lt;code&gt;storage_account_subscription_id&lt;/code&gt; first. Then later on, when you remove that and the other access_key properties maybe Terraform will do the right thing?&lt;/p&gt;
&lt;h3&gt;Solution resource&lt;/h3&gt;
&lt;p&gt;If you ever hit the &lt;strong&gt;Save&lt;/strong&gt; button on the Azure SQL &lt;strong&gt;Auditing&lt;/strong&gt; page, you may end up with a Solution resource being created for your auditing. This is useful, though it can cause problems if you are trying to destroy your Terraform resources, as it can put locks on the resources and Terraform doesn&apos;t know to destroy the solution resource first.&lt;/p&gt;
&lt;p&gt;You could try to pre-emptively create the solution resource in Terraform. For example:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;resource &quot;azurerm_log_analytics_solution&quot; &quot;example&quot; {
  solution_name         = &quot;SQLAuditing&quot;
  location              = data.azurerm_resource_group.rg.location
  resource_group_name   = data.azurerm_resource_group.rg.name
  workspace_resource_id = azurerm_log_analytics_workspace.la.id
  workspace_name        = azurerm_log_analytics_workspace.la.name

  plan {
    publisher = &quot;Microsoft&quot;
    product   = &quot;SQLAuditing&quot;
  }

  depends_on = [azurerm_monitor_diagnostic_setting.mssql_server]
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Though it seems that when you use Terraform to create this resource, it names it &lt;code&gt;SQLAuditing(log-terraform-sql-auditing-australiaeast)&lt;/code&gt;, whereas if you use the portal, it is named &lt;code&gt;SQLAuditing[log-terraform-sql-auditing-australiaeast]&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;So instead this looks like a good use for the AzApi provider and the &lt;a href=&quot;https://registry.terraform.io/providers/Azure/azapi/latest/docs/resources/resource&quot;&gt;&lt;code&gt;azapi_resource&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;resource &quot;azapi_resource&quot; &quot;symbolicname&quot; {
  type      = &quot;Microsoft.OperationsManagement/solutions@2015-11-01-preview&quot;
  name      = &quot;SQLAuditing[${azurerm_log_analytics_workspace.la.name}]&quot;
  location  = data.azurerm_resource_group.rg.location
  parent_id = data.azurerm_resource_group.rg.id

  tags = {}
  body = {
    plan = {
      name          = &quot;SQLAuditing[${azurerm_log_analytics_workspace.la.name}]&quot;
      product       = &quot;SQLAuditing&quot;
      promotionCode = &quot;&quot;
      publisher     = &quot;Microsoft&quot;
    }
    properties = {
      containedResources = [
        &quot;${azurerm_log_analytics_workspace.la.id}/views/SQLSecurityInsights&quot;,
        &quot;${azurerm_log_analytics_workspace.la.id}/views/SQLAccessToSensitiveData&quot;
      ]
      referencedResources = []
      workspaceResourceId = azurerm_log_analytics_workspace.la.id
    }
  }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Other troubleshooting tips&lt;/h2&gt;
&lt;p&gt;The Azure CLI can also be useful in checking what the current state of audit configuration is.&lt;/p&gt;
&lt;p&gt;Here&apos;s two examples showing auditing configured for all three destinations:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;az monitor diagnostic-settings list --resource /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-terraform-sql-auditing-australiaeast/providers/Microsoft.Sql/servers/sql-terraform-sql-auditing-australiaeast/databases/master
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;gives the following:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;[
  {
    &quot;eventHubAuthorizationRuleId&quot;: &quot;/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-terraform-sql-auditing-australiaeast/providers/Microsoft.EventHub/namespaces/evhns-terraform-sql-auditing-australiaeast/authorizationRules/evhar-terraform-sql-auditing-australiaeast&quot;,
    &quot;eventHubName&quot;: &quot;evh-terraform-sql-auditing-australiaeast&quot;,
    &quot;id&quot;: &quot;/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg-terraform-sql-auditing-australiaeast/providers/microsoft.sql/servers/sql-terraform-sql-auditing-australiaeast/databases/master/providers/microsoft.insights/diagnosticSettings/diagnostic_setting&quot;,
    &quot;logs&quot;: [
      {
        &quot;category&quot;: &quot;SQLSecurityAuditEvents&quot;,
        &quot;enabled&quot;: true,
        &quot;retentionPolicy&quot;: {
          &quot;days&quot;: 0,
          &quot;enabled&quot;: false
        }
      },
      {
        &quot;category&quot;: &quot;SQLInsights&quot;,
        &quot;enabled&quot;: false,
        &quot;retentionPolicy&quot;: {
          &quot;days&quot;: 0,
          &quot;enabled&quot;: false
        }
      },
      {
        &quot;category&quot;: &quot;AutomaticTuning&quot;,
        &quot;enabled&quot;: false,
        &quot;retentionPolicy&quot;: {
          &quot;days&quot;: 0,
          &quot;enabled&quot;: false
        }
      },
      {
        &quot;category&quot;: &quot;QueryStoreRuntimeStatistics&quot;,
        &quot;enabled&quot;: false,
        &quot;retentionPolicy&quot;: {
          &quot;days&quot;: 0,
          &quot;enabled&quot;: false
        }
      },
      {
        &quot;category&quot;: &quot;QueryStoreWaitStatistics&quot;,
        &quot;enabled&quot;: false,
        &quot;retentionPolicy&quot;: {
          &quot;days&quot;: 0,
          &quot;enabled&quot;: false
        }
      },
      {
        &quot;category&quot;: &quot;Errors&quot;,
        &quot;enabled&quot;: false,
        &quot;retentionPolicy&quot;: {
          &quot;days&quot;: 0,
          &quot;enabled&quot;: false
        }
      },
      {
        &quot;category&quot;: &quot;DatabaseWaitStatistics&quot;,
        &quot;enabled&quot;: false,
        &quot;retentionPolicy&quot;: {
          &quot;days&quot;: 0,
          &quot;enabled&quot;: false
        }
      },
      {
        &quot;category&quot;: &quot;Timeouts&quot;,
        &quot;enabled&quot;: false,
        &quot;retentionPolicy&quot;: {
          &quot;days&quot;: 0,
          &quot;enabled&quot;: false
        }
      },
      {
        &quot;category&quot;: &quot;Blocks&quot;,
        &quot;enabled&quot;: false,
        &quot;retentionPolicy&quot;: {
          &quot;days&quot;: 0,
          &quot;enabled&quot;: false
        }
      },
      {
        &quot;category&quot;: &quot;Deadlocks&quot;,
        &quot;enabled&quot;: false,
        &quot;retentionPolicy&quot;: {
          &quot;days&quot;: 0,
          &quot;enabled&quot;: false
        }
      },
      {
        &quot;category&quot;: &quot;DevOpsOperationsAudit&quot;,
        &quot;enabled&quot;: false,
        &quot;retentionPolicy&quot;: {
          &quot;days&quot;: 0,
          &quot;enabled&quot;: false
        }
      }
    ],
    &quot;metrics&quot;: [
      {
        &quot;category&quot;: &quot;Basic&quot;,
        &quot;enabled&quot;: false,
        &quot;retentionPolicy&quot;: {
          &quot;days&quot;: 0,
          &quot;enabled&quot;: false
        }
      },
      {
        &quot;category&quot;: &quot;InstanceAndAppAdvanced&quot;,
        &quot;enabled&quot;: false,
        &quot;retentionPolicy&quot;: {
          &quot;days&quot;: 0,
          &quot;enabled&quot;: false
        }
      },
      {
        &quot;category&quot;: &quot;WorkloadManagement&quot;,
        &quot;enabled&quot;: false,
        &quot;retentionPolicy&quot;: {
          &quot;days&quot;: 0,
          &quot;enabled&quot;: false
        }
      }
    ],
    &quot;name&quot;: &quot;diagnostic_setting&quot;,
    &quot;resourceGroup&quot;: &quot;rg-terraform-sql-auditing-australiaeast&quot;,
    &quot;type&quot;: &quot;Microsoft.Insights/diagnosticSettings&quot;,
    &quot;workspaceId&quot;: &quot;/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-terraform-sql-auditing-australiaeast/providers/Microsoft.OperationalInsights/workspaces/log-terraform-sql-auditing-australiaeast&quot;
  }
]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And the Azure SQL audit policy&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;az sql server audit-policy show -g rg-terraform-sql-auditing-australiaeast -n sql-terraform-sql-auditing-australiaeast
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Gives&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{
  &quot;auditActionsAndGroups&quot;: [
    &quot;SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP&quot;,
    &quot;FAILED_DATABASE_AUTHENTICATION_GROUP&quot;,
    &quot;BATCH_COMPLETED_GROUP&quot;
  ],
  &quot;blobStorageTargetState&quot;: &quot;Enabled&quot;,
  &quot;eventHubAuthorizationRuleId&quot;: &quot;/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-terraform-sql-auditing-australiaeast/providers/Microsoft.EventHub/namespaces/evhns-terraform-sql-auditing-australiaeast/authorizationRules/evhar-terraform-sql-auditing-australiaeast&quot;,
  &quot;eventHubName&quot;: &quot;evh-terraform-sql-auditing-australiaeast&quot;,
  &quot;eventHubTargetState&quot;: &quot;Enabled&quot;,
  &quot;id&quot;: &quot;/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-terraform-sql-auditing-australiaeast/providers/Microsoft.Sql/servers/sql-terraform-sql-auditing-australiaeast/auditingSettings/Default&quot;,
  &quot;isAzureMonitorTargetEnabled&quot;: true,
  &quot;isDevopsAuditEnabled&quot;: null,
  &quot;isManagedIdentityInUse&quot;: true,
  &quot;isStorageSecondaryKeyInUse&quot;: null,
  &quot;logAnalyticsTargetState&quot;: &quot;Enabled&quot;,
  &quot;logAnalyticsWorkspaceResourceId&quot;: &quot;/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-terraform-sql-auditing-australiaeast/providers/Microsoft.OperationalInsights/workspaces/log-terraform-sql-auditing-australiaeast&quot;,
  &quot;name&quot;: &quot;Default&quot;,
  &quot;queueDelayMs&quot;: null,
  &quot;resourceGroup&quot;: &quot;rg-terraform-sql-auditing-australiaeast&quot;,
  &quot;retentionDays&quot;: 6,
  &quot;state&quot;: &quot;Enabled&quot;,
  &quot;storageAccountAccessKey&quot;: null,
  &quot;storageAccountSubscriptionId&quot;: &quot;00000000-0000-0000-0000-000000000000&quot;,
  &quot;storageEndpoint&quot;: &quot;https://sttfsqlauditauew0o.blob.core.windows.net/&quot;,
  &quot;type&quot;: &quot;Microsoft.Sql/servers/auditingSettings&quot;
}
&lt;/code&gt;&lt;/pre&gt;
</content>
    <media:thumbnail url="https://david.gardiner.net.au/_astro/azure-logo.BF5E_tzp.jpg" width="120" height="120"/>
    <media:content medium="image" url="https://david.gardiner.net.au/_astro/azure-logo.BF5E_tzp.jpg" width="120" height="120"/>
  </entry>
  <entry>
    <id>https://david.gardiner.net.au/2021/03/sql-client-aliases</id>
    <updated>2021-03-10T11:00:00.000+10:30</updated>
    <title>SQL client alias not working</title>
    <link href="https://david.gardiner.net.au/2021/03/sql-client-aliases" rel="alternate" type="text/html" title="SQL client alias not working"/>
    <category term="SQL"/>
    <published>2021-03-10T11:00:00.000+10:30</published>
    <summary type="html">This morning I was trying to create a SQL client alias. An application assumes my local SQL Server instance is named &apos;SQLEXPRESS&apos; but I&apos;ve installed SQL Server 2019 Developer Edition (which installs as the default instance). I opened SQL Server 2019 Configuration Manager and created an alias.. It didn&apos;t work. I can never remember whether to use the &apos;32bit&apos;  configuration or the other one! I tried both, still no success.</summary>
    <content type="html">

&lt;p&gt;This morning I was trying to create a SQL client alias. An application assumes my local SQL Server instance is named &apos;SQLEXPRESS&apos; but I&apos;ve installed SQL Server 2019 Developer Edition (which installs as the default instance).&lt;/p&gt;
&lt;p&gt;I opened SQL Server 2019 Configuration Manager and created an alias.. It didn&apos;t work. I can never remember whether to use the &apos;32bit&apos;  configuration or the other one! I tried both, still no success.&lt;/p&gt;
&lt;p&gt;I checked Google to see I was doing it right. Yep, &lt;a href=&quot;https://www.mssqltips.com/sqlservertip/1620/how-to-setup-and-use-a-sql-server-alias/&quot;&gt;tried this&lt;/a&gt; and still no luck.&lt;/p&gt;
&lt;p&gt;Let&apos;s double-check how my local instance is configured..&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://david.gardiner.net.au/_astro/sql-server-config-manager-protocols.D0sCHQLb_ZiIlAQ.webp&quot; alt=&quot;SQL Server Configuration Manager, showing Protocols node&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Whoops! Aliases can only use &apos;Named Pipes&apos; or &apos;TCP/IP&apos; and both of those protocols are disabled.&lt;/p&gt;
&lt;p&gt;Let&apos;s enable TCP/IP&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://david.gardiner.net.au/_astro/sql-server-config-manager-tcp-enable.BbRsc343_ZJbPm1.webp&quot; alt=&quot;Enable TCP/IP protocol&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And enable binding to 1433 on localhost for IPv4 and IPv6. I won&apos;t bother with the other IP addresses as I&apos;m not planning to share this instance externally.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://david.gardiner.net.au/_astro/sql-server-config-manager-ip-enable.C_2AUx9-_2clj6S.webp&quot; alt=&quot;Enable IP Addresses&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Restart the SQL service and we&apos;re all good.&lt;/p&gt;
&lt;p&gt;Oh.. and for my own reference, the &apos;32bit&apos; client alias did the trick for SSMS, but for a .NET application I needed also add a non-32bit alias too.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <id>https://david.gardiner.net.au/2018/08/converting-sql-server-bacpac-to-dacpac</id>
    <updated>2018-08-27T21:30:00.000+09:30</updated>
    <title>Converting a SQL Server .bacpac to a .dacpac</title>
    <link href="https://david.gardiner.net.au/2018/08/converting-sql-server-bacpac-to-dacpac" rel="alternate" type="text/html" title="Converting a SQL Server .bacpac to a .dacpac"/>
    <category term="SQL"/>
    <published>2018-08-27T21:30:00.000+09:30</published>
    <summary type="html">Microsoft SQL Server has two related portable file formats - the DACPAC and the BACPAC. Quoting Data-tier Applications: A DAC is a self-contained unit of SQL Server database deployment that enables data-tier developers and database administrators to package SQL Server objects into a portable artifact called a DAC package, also known as a DACPAC.
A BACPAC is a related artifact that encapsulates the database schema as well as the data stored in the database. …</summary>
    <content type="html">

&lt;p&gt;Microsoft SQL Server has two related portable file formats - the DACPAC and the BACPAC. Quoting &lt;a href=&quot;https://learn.microsoft.com/sql/tools/sql-database-projects/concepts/data-tier-applications/overview?view=sql-server-2017&quot;&gt;Data-tier Applications:&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;A DAC is a self-contained unit of SQL Server database deployment that enables data-tier developers and database administrators to package SQL Server objects into a portable artifact called a DAC package, also known as a DACPAC.&lt;/em&gt;
&lt;em&gt;A BACPAC is a related artifact that encapsulates the database schema as well as the data stored in the database.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;When they say related, they&apos;re not kidding! Both of these files formats are based on the &lt;a href=&quot;https://en.wikipedia.org/wiki/Open_Packaging_Conventions&quot;&gt;Open Packaging Conventions&lt;/a&gt; (a fancy way of saying it&apos;s a .zip file with some other bits), and cracking them open you discover that a bacpac file is basically a dacpac with a few extra files and a couple of different settings. Knowing this, it should be possible to manually convert a bacpac to a dacpac.&lt;/p&gt;
&lt;p&gt;First, unzip the .bacpac file (using 7-zip, or rename to .zip and use Windows File Explorer’s Extract Archive).&lt;/p&gt;
&lt;p&gt;Now do the following actions (you could do these programmatically if this is something you need to do repeatedly):&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Edit model.xml&lt;ol&gt;
&lt;li&gt;Change DataSchemaModel@SchemaVersion to 2.4&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;Edit Origin.xml&lt;ol&gt;
&lt;li&gt;Change ContainsExportedData to false&lt;/li&gt;
&lt;li&gt;Change ModelSchemaVersion to 2.4&lt;/li&gt;
&lt;li&gt;Remove ExportStatistics&lt;/li&gt;
&lt;li&gt;Recalculate the SHA256 checksum for model.xml and update the value stored in &lt;code&gt;Checksums/Checksum@Uri=’/model.xml’&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;Remove directories &lt;code&gt;\_rels&lt;/code&gt; and Data&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Now re-zip up the remaining files and change the file suffix back to .dacpac&lt;/p&gt;
&lt;p&gt;To verify that the .dacpac is valid, try using SSMS with the Upgrade Data-tier Application wizard. Run it against any database and if you can proceed to without error to the &quot;Review Upgrade Plan&quot; step, you should be good to go.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <id>https://david.gardiner.net.au/2017/06/running-sql-server-configuration</id>
    <updated>2017-06-24T21:21:00.001+09:30</updated>
    <title>Running SQL Server Configuration Manager without SQL Server installed</title>
    <link href="https://david.gardiner.net.au/2017/06/running-sql-server-configuration" rel="alternate" type="text/html" title="Running SQL Server Configuration Manager without SQL Server installed"/>
    <category term="SQL"/>
    <published>2017-06-24T21:21:00.001+09:30</published>
    <summary type="html">I like to have SQL Server Management Studio (SSMS) installed as part of my standard development environment. Usually this is because I also have an instance of SQL Server Developer or Express Edition installed, but not always. One thing I noticed with the separate distribution of SSMS is that it also includes all the other management tools that used to be bundled with the server, like SQL Server Configuration Manager.</summary>
    <content type="html">&lt;p&gt;I like to have SQL Server Management Studio (SSMS) installed as part of my standard development environment. Usually this is because I also have an instance of SQL Server Developer or Express Edition installed, but not always.&lt;/p&gt;
&lt;p&gt;One thing I noticed with the separate distribution of SSMS is that it also includes all the other management tools that used to be bundled with the server, like SQL Server Configuration Manager.&lt;/p&gt;
&lt;p&gt;I wanted to change the SQL Client configuration settings and Configuration Manager is the tool I’d use to do that. But when I fired it up (it’s named SQL Server vNext CTP2.0 Configuration Manager in the latest release of SSMS), I’ve been greeted with this message:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://lh3.googleusercontent.com/-TKFQLW9BWbo/WU5SNnnemrI/AAAAAAAACGc/oFhsWICEiKkN35EwuqgaizujlAPR41DaQCHMYCw/2017-06-24_20-44-48%255B10%255D?imgmax=800&quot; alt=&quot;Error dialog from SQL Server Configuration Manager&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I don’t see this problem when an instance of SQL Server is installed though.&lt;/p&gt;
&lt;p&gt;The fix is documented in &lt;a href=&quot;https://support.microsoft.com/en-us/help/956013/error-message-when-you-open-sql-server-configuration-manager-in-sql-server-cannot-connect-to-wmi-provider.-you-do-not-have-permission-or-the-server-is-unreachable&quot;&gt;KB 956013&lt;/a&gt;. I ran the following from an elevated command prompt:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;mofcomp &quot;%programfiles(x86)%\Microsoft SQL Server\140\shared\sqlmgmproviderxpsp2up.mof&quot;&lt;/code&gt;&lt;/p&gt;


&lt;p&gt;Now SQL Server Configuration Manager starts up without error&lt;/p&gt;
&lt;p&gt;Oh, and the easiest way to install SSMS is to use Chocolatey!&lt;/p&gt;
&lt;p&gt;&lt;code&gt;choco install sql-server-management-studio&lt;/code&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <id>https://david.gardiner.net.au/2016/03/installing-future-sql-server-updates</id>
    <updated>2016-03-28T08:52:00.000+10:30</updated>
    <title>Installing future SQL Server updates with confidence</title>
    <link href="https://david.gardiner.net.au/2016/03/installing-future-sql-server-updates" rel="alternate" type="text/html" title="Installing future SQL Server updates with confidence"/>
    <category term="SQL"/>
    <published>2016-03-28T08:52:00.000+10:30</published>
    <summary type="html">Great to read that Microsoft are now making the “cumulative update” packages ‘recommended’ installs, and the updates themselves will be easier to obtain - no longer requiring a email address to download directly, and also being listed in Windows Update Catalog (and maybe in the future as an optional update on Microsoft Update).</summary>
    <content type="html">&lt;p&gt;Great to &lt;a href=&quot;https://learn.microsoft.com/archive/blogs/sqlreleaseservices/announcing-updates-to-the-sql-server-incremental-servicing-model-ism&quot;&gt;read that Microsoft are now making the “cumulative update” packages ‘recommended’ installs&lt;/a&gt;, and the updates themselves will be easier to obtain - no longer requiring a email address to download directly, and also being listed in Windows Update Catalog (and maybe in the future as an optional update on Microsoft Update).&lt;/p&gt;
&lt;p&gt;As a developer, I’ve often installed the latest CU (cumulative update) just because I like to be current on my own PC – but I’ve traditionally been more conservative with production SQL Servers that I’ve had to look after over the years. In the latter case I’ve installed the latest service pack, but only added a CU if it seemed likely to address any issue we might be having at the time.&lt;/p&gt;
&lt;p&gt;With this change, now pushing out the latest CU can be done with more confidence and probably should be considered part of maintaining your SQL Server infrastructure. Quoting from the above article:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;You should plan to install a CU with the same level of confidence you plan to install SPs (Service Packs) as they are released. This is because CU’s are certified and tested to the level of SP’s.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;A few years back I remember thinking that the SQL Server team had really set the standard for releasing regular updates for their products (especially compared to the lack of updates at the time to fix problems with older versions of Visual Studio 2005/2008). Since then the VS team have upped their game, and now they are pushing new major servicing updates out around every quarter. That doesn’t include out-of-band updates to VS extensions that are done more frequently.&lt;/p&gt;
&lt;p&gt;So it’s great to see the SQL Server team stepping up the pace another notch.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <id>https://david.gardiner.net.au/2015/03/alter-authorization</id>
    <updated>2015-03-10T16:28:00.001+10:30</updated>
    <title>ALTER AUTHORIZATION</title>
    <link href="https://david.gardiner.net.au/2015/03/alter-authorization" rel="alternate" type="text/html" title="ALTER AUTHORIZATION"/>
    <category term="SQL"/>
    <published>2015-03-10T16:28:00.001+10:30</published>
    <summary type="html">(For my own reference) To resolve this issue in Microsoft SQL Server (often observed when you restore a database that came from another server):  Run this: alter authorization on database::[MyDbName] to sa;</summary>
    <content type="html">&lt;p&gt;(For my own reference)&lt;/p&gt;
&lt;p&gt;To resolve this issue in Microsoft SQL Server (often observed when you restore a database that came from another server):&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;../../assets/2015/03/image%5b4%5d.png&quot; alt=&quot;SQL Server Management Studio information dialog&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Run this:&lt;/p&gt;
&lt;p&gt;alter authorization on database::[MyDbName] to sa;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <id>https://david.gardiner.net.au/2014/07/ssdt-bi-install-logs</id>
    <updated>2014-07-07T22:56:00.001+09:30</updated>
    <title>SSDT BI Install Logs</title>
    <link href="https://david.gardiner.net.au/2014/07/ssdt-bi-install-logs" rel="alternate" type="text/html" title="SSDT BI Install Logs"/>
    <category term="SQL"/>
    <published>2014-07-07T22:56:00.001+09:30</published>
    <summary type="html">A short note for my reference. When you install SQL Server Data Tools – Business Intelligence for Visual Studio 2013, the installer writes a log file to a folder under C:\Program Files (x86)\Microsoft SQL Server\120\Setup Bootstrap\Log\ Handy if you’re trying to install it remotely or via an unattended install file and need to diagnose any errors.</summary>
    <content type="html">&lt;p&gt;A short note for my reference. When you install &lt;a href=&quot;https://web.archive.org/web/20211204214126/https://www.microsoft.com/en-au/download/details.aspx?id=42313&quot;&gt;SQL Server Data Tools – Business Intelligence for Visual Studio 2013&lt;/a&gt;, the installer writes a log file to a folder under &lt;code&gt;C:\Program Files (x86)\Microsoft SQL Server\120\Setup Bootstrap\Log\&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Handy if you’re trying to install it remotely or via an unattended install file and need to diagnose any errors.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <id>https://david.gardiner.net.au/2013/12/chris-testa-o-on-increasing-business</id>
    <updated>2013-12-18T15:08:00.001+10:30</updated>
    <title>Chris Testa-O&apos;Neill on Increasing Business and IT collaboration with SQL Server</title>
    <link href="https://david.gardiner.net.au/2013/12/chris-testa-o-on-increasing-business" rel="alternate" type="text/html" title="Chris Testa-O&apos;Neill on Increasing Business and IT collaboration with SQL Server"/>
    <category term="SQL"/>
    <published>2013-12-18T15:08:00.001+10:30</published>
    <summary type="html">I was one of the few who braved the 39°C heat outside to hear Chris Testa-O&apos;Neill (@ctesta_oneill) speak at this month&apos;s Adelaide SQL Server User Group. Great to have Chris back in Adelaide again. It proved to be a really interesting presentation about what BI tools are now available, and what tools are appropriate for what problems.</summary>
    <content type="html">
&lt;p&gt;&lt;img src=&quot;../../assets/2013/12/wp_20131218_005_thumb%5b2%5d.jpg&quot; alt=&quot;Chris presenting on stage&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I was one of the few who braved the 39°C heat outside to hear &lt;a href=&quot;https://sqlblogcasts.com/blogs/testas/&quot;&gt;Chris Testa-O&apos;Neill&lt;/a&gt; (&lt;a href=&quot;https://twitter.com/ctesta_oneill&quot;&gt;@ctesta_oneill&lt;/a&gt;) speak at this month&apos;s &lt;a href=&quot;https://web.archive.org/web/20161002050208/http://adelaide.sqlpass.org:80/&quot;&gt;Adelaide SQL Server User Group&lt;/a&gt;. Great to have Chris back in Adelaide again.&lt;/p&gt;
&lt;p&gt;It proved to be a really interesting presentation about what BI tools are now available, and what tools are appropriate for what problems.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Reporting Services&lt;/li&gt;
&lt;li&gt;Report Builder&lt;/li&gt;
&lt;li&gt;PowerView&lt;/li&gt;
&lt;li&gt;PowerPivot&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The talk concluded with a nice demonstration of setting up PowerPivot in Excel, highlighting what could be achieved by a business &apos;power user&apos;, and what areas they would require assistance from a BI expert.&lt;/p&gt;
&lt;p&gt;We also met in a different room from normal which I think most people thought was a better space. Plus (as you may observe in the photo above), it has a grand piano – I&apos;m sure we could find a use for that somehow!&lt;/p&gt;
</content>
  </entry>
  <entry>
    <id>https://david.gardiner.net.au/2013/04/ssdt-talk-notes</id>
    <updated>2013-04-22T17:00:00.000+09:30</updated>
    <title>SSDT Talk Notes</title>
    <link href="https://david.gardiner.net.au/2013/04/ssdt-talk-notes" rel="alternate" type="text/html" title="SSDT Talk Notes"/>
    <category term="SQL"/>
    <category term="Talks"/>
    <published>2013-04-22T17:00:00.000+09:30</published>
    <summary type="html">Here&apos;s a summary of the talk I did at the Adelaide SQL Server User Group last week. Most of the talk was a demo (only a couple of PowerPoint slides) so hopefully this is a useful reference for those who attended. Evolution of DataDude The new way of shipping BIDS Ships with SQL Server 2012 and Visual Studio 2012 Replaces &apos;Database Projects&apos; from previous versions Updates every 4-6 months (in time for SQL Azure updates) Ships with VS 2012 and with SQL 2012 …</summary>
    <content type="html">&lt;p&gt;Here&apos;s a summary of the talk I did at the Adelaide SQL Server User Group last week. Most of the talk was a demo (only a couple of PowerPoint slides) so hopefully this is a useful reference for those who attended.&lt;/p&gt;
&lt;h2&gt;Intro to SSDT&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Evolution of DataDude&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The new way of shipping BIDS&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Ships with SQL Server 2012 and Visual Studio 2012&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Replaces &apos;Database Projects&apos; from previous versions&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Updates every 4-6 months (in time for SQL Azure updates)&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Ships with VS 2012 and with SQL 2012&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Free tool - use VS shell or integrate with existing&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Will update frequently to keep up with SQL Azure features&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Connected&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;SQL Server Object Explorer&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Connect to local or Azure&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Queries&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Execution Plans&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Client stats&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Disconnected&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Database projects&lt;/li&gt;
&lt;li&gt;Model-based&lt;/li&gt;
&lt;li&gt;Edition-aware targeting (project properties)&lt;ul&gt;
&lt;li&gt;Can switch to azure to check if database is compatible with azure&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Table designer/code view&lt;ul&gt;
&lt;li&gt;Synchronised&lt;/li&gt;
&lt;li&gt;Demo deleting a column&lt;ul&gt;
&lt;li&gt;Can see errors (even before building) of related objects (eg. Views) that reference column&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Build creates a &apos;dacpac&apos; (Data-tier Application Package)&lt;ul&gt;
&lt;li&gt;&apos;Upgrade data-tier application&apos; from SMSS&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Declarative model&lt;/li&gt;
&lt;li&gt;&apos;Create New Project&apos; via SQL Server Object Explorer&lt;/li&gt;
&lt;li&gt;F5 builds and deploys database to localdb&lt;/li&gt;
&lt;li&gt;Snapshots&lt;/li&gt;
&lt;li&gt;Import .sql files&lt;/li&gt;
&lt;li&gt;Code analysis&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Schema Compare&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Connected, Project, dacpac or snapshot&lt;/li&gt;
&lt;li&gt;Update changes (defaults to not losing data)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Refactoring&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Expand wildcards to column names - SELECT *&lt;/li&gt;
&lt;li&gt;Semantic refactoring through model - not just find/replace&lt;/li&gt;
&lt;li&gt;Go to Reference, Find all references&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Publish database&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Directly&lt;/li&gt;
&lt;li&gt;Via SQL script&lt;/li&gt;
&lt;li&gt;DACPAC&lt;ul&gt;
&lt;li&gt;C:\Program Files (x86)\Microsoft SQL Server\110\DAC\bin\sqlpackage.exe&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&quot;c:\Program Files (x86)\Microsoft SQL Server\110\dac\bin\SqlPackage.exe&quot; /action:driftreport /tsn:.\sql2012&lt;/p&gt;
&lt;p&gt;/outputpath:c:\tmp\driftreport.xml /tdn:SsdtSample&lt;/p&gt;
&lt;h2&gt;Unit testing&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Right-click on stored proc to create unit tests&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;3rd Party Integration and extensions&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Red Gate SQL Compare (beta)&lt;/li&gt;
&lt;li&gt;Version control&lt;/li&gt;
&lt;li&gt;Laan SQL Formatter (soon)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Further reading&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://learn.microsoft.com/sql/ssdt/download-sql-server-data-tools-ssdt?view=sql-server-ver17&quot;&gt;http://msdn.microsoft.com/en-us/data/tools.aspx&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://blogs.technet.com/b/ilikesql_by_dandyman/archive/2013/03/10/installing-sql-server-data-tools-bi-and-data-projects-in-visual-studio-2012-or-visual-studio-2012-shell.aspx&quot;&gt;http://blogs.technet.com/b/ilikesql_by_dandyman/archive/2013/03/10/installing-sql-server-data-tools-bi-and-data-projects-in-visual-studio-2012-or-visual-studio-2012-shell.aspx&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
  </entry>
  <entry>
    <id>https://david.gardiner.net.au/2013/04/speaking-on-ssdt-at-adelaide-sql-user</id>
    <updated>2013-04-10T00:48:00.001+09:30</updated>
    <title>Speaking on SSDT at Adelaide SQL User Group</title>
    <link href="https://david.gardiner.net.au/2013/04/speaking-on-ssdt-at-adelaide-sql-user" rel="alternate" type="text/html" title="Speaking on SSDT at Adelaide SQL User Group"/>
    <category term="SQL"/>
    <category term="Talks"/>
    <category term="Faith"/>
    <published>2013-04-10T00:48:00.001+09:30</published>
    <summary type="html">Today just happens to be T-SQL Tuesday, and this month&apos;s question is &quot;how did you come to love presenting?&quot;</summary>
    <content type="html">
&lt;p&gt;&lt;img src=&quot;https://bobpusateri.com/archive/2013/04/invitation-to-t-sql-tuesday-41-presenting-and-loving-it/&quot; alt=&quot;T-SQL Tuesday logo&quot; /&gt;Today just happens to be T-SQL Tuesday, and this month&apos;s question is &quot;&lt;a href=&quot;https://bobpusateri.com/archive/2013/04/invitation-to-t-sql-tuesday-41-presenting-and-loving-it/&quot;&gt;how did you come to love presenting?&lt;/a&gt;&quot;&lt;/p&gt;
&lt;p&gt;The first time I presented in front of a group? hmm that&apos;s a tough question. Actually now that I think about it, it might have been the first time I did the kids&apos; story as a young teenager teaching Sunday School. Keeping the attention of 5 year olds is a tough gig, but I must have done ok as that&apos;s something I still enjoy doing to this day. Sunday school, youth groups, camps, church conferences – they all gave me opportunities to try out &quot;being up the front&quot;.&lt;/p&gt;
&lt;p&gt;Moving more to the IT-side of things, getting opportunities to present at local user groups and events has definitely been a highlight. The last couple of years I&apos;ve also been able to work in and present at the hands-on-labs at Microsoft&apos;s TechEd conferences, which is great fun.&lt;/p&gt;
&lt;p&gt;One great thing about presenting is that it can be a two-way street. Sometimes you end up learning just as much from those you&apos;re presenting to as you hope they did from you.&lt;/p&gt;
&lt;p&gt;Speaking of presenting, it&apos;s nice to be able to get back to the Adelaide SQL User Group next week and present on &lt;a href=&quot;https://learn.microsoft.com/sql/ssdt/download-sql-server-data-tools-ssdt?view=sql-server-ver17&quot;&gt;SQL Server Data Tools&lt;/a&gt;. It&apos;s something I&apos;ve been using a bit lately and thought it would be of interest to others too. I&apos;ve been involved with this group since it first started years ago, but for the last 12 months or so I&apos;ve been unable to make the Wednesday timeslot in person due to some family commitments, so I&apos;ll be looking forward to catching up with some old friends.&lt;/p&gt;
&lt;p&gt;If you&apos;re free next Wednesday lunchtime, &lt;a href=&quot;http://adssug201304.eventbrite.com.au/#&quot;&gt;feel free to register&lt;/a&gt; and come along. It would be great to see you!&lt;/p&gt;
</content>
  </entry>
</feed>
