<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4468522590561210250</id><updated>2026-07-24T10:18:13.482-07:00</updated><category term="Docker installation"/><category term="Error Messages in SQL Server 2008"/><title type='text'>MS SQL Server </title><subtitle type='html'>A comprehensive blog on code development.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://sqlserverfreak.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://sqlserverfreak.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>SPK</name><uri>http://www.blogger.com/profile/07569889026692963359</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>44</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4468522590561210250.post-2368834752300556069</id><published>2026-04-30T07:27:00.000-07:00</published><updated>2026-04-30T07:27:35.322-07:00</updated><title type='text'></title><content type='html'>
&lt;h2&gt;Simulate Slow Typing with PowerShell: Type SQL Code Over Extended Periods&lt;/h2&gt;

&lt;h3&gt;Introduction&lt;/h3&gt;
&lt;p&gt;Have you ever needed to simulate slow, character-by-character typing in Windows? Whether you&#39;re demonstrating code on a remote desktop, creating training videos, or just need to type slowly for testing purposes, this PowerShell script is perfect for the job.&lt;/p&gt;

&lt;p&gt;This script uses the Windows SendKeys API to simulate keyboard input and can type either generated SQL comments or code from a file over a specified time period (default: 30 minutes).&lt;/p&gt;

&lt;h3&gt;Features&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Type SQL code from a file or generate comment lines&lt;/li&gt;
&lt;li&gt;Customizable typing duration (default: 30 minutes)&lt;/li&gt;
&lt;li&gt;Automatic 10-second countdown before typing starts&lt;/li&gt;
&lt;li&gt;Works with remote desktop sessions&lt;/li&gt;
&lt;li&gt;Launches on-screen keyboard for visual reference&lt;/li&gt;
&lt;li&gt;Real-time progress tracking&lt;/li&gt;
&lt;li&gt;Handles special characters gracefully&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Prerequisites&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Windows PC with PowerShell&lt;/li&gt;
&lt;li&gt;.NET Framework (included with Windows)&lt;/li&gt;
&lt;li&gt;Target application (SSMS, Notepad, VS Code, etc.)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;How It Works&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;The script launches the Windows on-screen keyboard&lt;/li&gt;
&lt;li&gt;You have 10 seconds to click on your target window and position the cursor&lt;/li&gt;
&lt;li&gt;After the countdown, the script automatically starts typing&lt;/li&gt;
&lt;li&gt;Each character is sent with a 50ms delay&lt;/li&gt;
&lt;li&gt;Lines are separated by configurable delays to spread typing over the desired time period&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;Installation &amp;amp; Setup&lt;/h3&gt;

&lt;h4&gt;Step 1: Create the Script File&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;Open Notepad or your favorite text editor&lt;/li&gt;
&lt;li&gt;Copy the entire script code (see below)&lt;/li&gt;
&lt;li&gt;Save the file as &lt;code&gt;SlowTypeScriptWithTargetWindow.ps1&lt;/code&gt; in a folder (e.g., &lt;code&gt;C:\Users\YourUsername\&lt;/code&gt;)&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;Step 2: Enable PowerShell Execution&lt;/h4&gt;
&lt;p&gt;Before running the script, you need to allow PowerShell to execute scripts. Open PowerShell as Administrator and run:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Usage&lt;/h3&gt;

&lt;h4&gt;Option 1: Generate 10,000 Comment Lines (Default)&lt;/h4&gt;
&lt;p&gt;Open PowerShell and navigate to the script folder, then run:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;.\SlowTypeScriptWithTargetWindow.ps1&lt;/code&gt;&lt;/pre&gt;

&lt;h4&gt;Option 2: Type SQL Code from a File&lt;/h4&gt;
&lt;pre&gt;&lt;code&gt;.\SlowTypeScriptWithTargetWindow.ps1 -FilePath &quot;C:\path\to\your\file.sql&quot;&lt;/code&gt;&lt;/pre&gt;

&lt;h4&gt;Option 3: Customize Total Time&lt;/h4&gt;
&lt;pre&gt;&lt;code&gt;.\SlowTypeScriptWithTargetWindow.ps1 -TotalMinutes 60&lt;/code&gt;&lt;/pre&gt;

&lt;h4&gt;Option 4: Combine Options&lt;/h4&gt;
&lt;pre&gt;&lt;code&gt;.\SlowTypeScriptWithTargetWindow.ps1 -FilePath &quot;C:\path\to\your\file.sql&quot; -TotalMinutes 45&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Step-by-Step Execution Guide&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Open PowerShell&lt;/strong&gt; in the directory where you saved the script&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Run the command&lt;/strong&gt; with your desired parameters&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The script will display:&lt;/strong&gt;
  &lt;ul&gt;
  &lt;li&gt;Configuration details (total lines, time, delay per line)&lt;/li&gt;
  &lt;li&gt;A 10-second countdown&lt;/li&gt;
  &lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;During the countdown:&lt;/strong&gt;
  &lt;ul&gt;
  &lt;li&gt;Click on your target window (SSMS, Notepad, etc.)&lt;/li&gt;
  &lt;li&gt;Position your cursor where you want the text to appear&lt;/li&gt;
  &lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;After countdown completes:&lt;/strong&gt;
  &lt;ul&gt;
  &lt;li&gt;Typing starts automatically&lt;/li&gt;
  &lt;li&gt;A progress bar shows real-time status&lt;/li&gt;
  &lt;li&gt;Do NOT click away from the target window&lt;/li&gt;
  &lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;When complete:&lt;/strong&gt;
  &lt;ul&gt;
  &lt;li&gt;Summary statistics are displayed&lt;/li&gt;
  &lt;li&gt;Total lines typed and elapsed time&lt;/li&gt;
  &lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;Troubleshooting&lt;/h3&gt;

&lt;h4&gt;Issue: &quot;Keyword delimiter is missing&quot; or &quot;Group delimiters are not balanced&quot;&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;These are expected for certain special characters&lt;/li&gt;
&lt;li&gt;The script handles them gracefully and continues typing&lt;/li&gt;
&lt;li&gt;The text will still appear correctly in your target window&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;Issue: Script won&#39;t run&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Ensure you&#39;ve set the execution policy: &lt;code&gt;Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Run PowerShell as Administrator&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;Issue: Text not appearing in target window&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Make sure the target window is in focus when typing starts&lt;/li&gt;
&lt;li&gt;The on-screen keyboard should be visible (it&#39;s just for reference)&lt;/li&gt;
&lt;li&gt;Check that you&#39;re using a compatible application (SSMS, Notepad, VS Code, etc.)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Complete Script Code&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Copy the code below and save it as SlowTypeScriptWithTargetWindow.ps1&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;
# PowerShell Script to type slowly using on-screen keyboard
# Can type SQL code from a file or generate comment lines
# User has 10 seconds to position cursor before typing starts

param(
    [string]$FilePath = &quot;&quot;,
    [int]$TotalMinutes = 30,
    [int]$LineCount = 10000
)

# Add required assemblies
Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName System.Drawing

# Calculate delay per line in milliseconds
$totalMilliseconds = $TotalMinutes * 60 * 1000
$delayPerLine = $totalMilliseconds / $LineCount

# Initialize code lines array
$codeLines = @()

# Check if file path is provided
if ($FilePath -and (Test-Path $FilePath)) {
    Write-Host &quot;Reading SQL code from file: $FilePath&quot; -ForegroundColor Cyan
    $codeLines = @(Get-Content -Path $FilePath)
    $LineCount = $codeLines.Count
    Write-Host &quot;Loaded $LineCount lines from file&quot; -ForegroundColor Green
}
else {
    # Generate SQL comment lines
    Write-Host &quot;Generating $LineCount SQL comment lines...&quot; -ForegroundColor Cyan
    for ($i = 1; $i -le $LineCount; $i++) {
        $codeLines += &quot;-- This is a SQL comment line $i&quot;
    }
    Write-Host &quot;Generated $LineCount comment lines&quot; -ForegroundColor Green
}

# Recalculate delay per line based on actual line count
$delayPerLine = $totalMilliseconds / $codeLines.Count

# Launch on-screen keyboard
Write-Host &quot;Launching on-screen keyboard...&quot; -ForegroundColor Cyan
Start-Process &quot;osk.exe&quot;
Start-Sleep -Seconds 2

# Show instructions
Write-Host &quot;&quot;
Write-Host &quot;========================================&quot; -ForegroundColor Green
Write-Host &quot;SLOW TYPE SCRIPT - READY TO START&quot; -ForegroundColor Green
Write-Host &quot;========================================&quot; -ForegroundColor Green
Write-Host &quot;&quot;
Write-Host &quot;Configuration:&quot; -ForegroundColor Yellow
Write-Host &quot;  Total lines to type: $($codeLines.Count)&quot; -ForegroundColor Yellow
Write-Host &quot;  Total time: $TotalMinutes minutes&quot; -ForegroundColor Yellow
Write-Host &quot;  Delay per line: $([math]::Round($delayPerLine / 1000, 2)) seconds&quot; -ForegroundColor Yellow
if ($FilePath -and (Test-Path $FilePath)) {
    Write-Host &quot;  Source: File ($FilePath)&quot; -ForegroundColor Yellow
}
else {
    Write-Host &quot;  Source: Generated SQL comments&quot; -ForegroundColor Yellow
}
Write-Host &quot;&quot;
Write-Host &quot;Instructions:&quot; -ForegroundColor Cyan
Write-Host &quot;  1. Click on your target window (SSMS, Notepad, etc.)&quot; -ForegroundColor Cyan
Write-Host &quot;  2. Position your cursor where you want to type&quot; -ForegroundColor Cyan
Write-Host &quot;  3. Typing will start automatically in 10 seconds&quot; -ForegroundColor Cyan
Write-Host &quot;&quot;
Write-Host &quot;Typing will start in 10 seconds...&quot; -ForegroundColor Green

# Wait 10 seconds before starting
for ($i = 10; $i -gt 0; $i--) {
    Write-Host &quot;Starting in $i seconds...&quot; -ForegroundColor Yellow
    Start-Sleep -Seconds 1
}

Write-Host &quot;&quot;
Write-Host &quot;Starting typing now...&quot; -ForegroundColor Green
Write-Host &quot;Do NOT click away from the target window!&quot; -ForegroundColor Yellow
Write-Host &quot;&quot;

# Type each line with delay
$lineNumber = 0
$startTime = Get-Date

foreach ($line in $codeLines) {
    $lineNumber++
    $elapsedSeconds = ((Get-Date) - $startTime).TotalSeconds
    $estimatedTotalSeconds = $TotalMinutes * 60
    $percentComplete = ($elapsedSeconds / $estimatedTotalSeconds) * 100
    
    Write-Progress -Activity &quot;Typing Code&quot; `
                   -Status &quot;Line $lineNumber of $($codeLines.Count) | Elapsed: $([math]::Round($elapsedSeconds, 0))s / $estimatedTotalSeconds`s&quot; `
                   -PercentComplete $percentComplete
    
    # Type the line character by character
    foreach ($char in $line.ToCharArray()) {
        try {
            # Escape special characters for SendKeys
            $charToSend = $char
            switch ($char) {
                &#39;{&#39; { $charToSend = &#39;{{}}&#39; }
                &#39;}&#39; { $charToSend = &#39;{{}}&#39; }
                &#39;+&#39; { $charToSend = &#39;{+}&#39; }
                &#39;^&#39; { $charToSend = &#39;{^}&#39; }
                &#39;%&#39; { $charToSend = &#39;{%}&#39; }
                &#39;~&#39; { $charToSend = &#39;{~}&#39; }
                &#39;(&#39; { $charToSend = &#39;(&#39;; [System.Windows.Forms.SendKeys]::SendWait($charToSend); Start-Sleep -Milliseconds 50; continue }
                &#39;)&#39; { $charToSend = &#39;)&#39;; [System.Windows.Forms.SendKeys]::SendWait($charToSend); Start-Sleep -Milliseconds 50; continue }
                &#39;[&#39; { $charToSend = &#39;[&#39;; [System.Windows.Forms.SendKeys]::SendWait($charToSend); Start-Sleep -Milliseconds 50; continue }
                &#39;]&#39; { $charToSend = &#39;]&#39;; [System.Windows.Forms.SendKeys]::SendWait($charToSend); Start-Sleep -Milliseconds 50; continue }
            }
            [System.Windows.Forms.SendKeys]::SendWait($charToSend)
        }
        catch {
            # Skip problematic characters and continue
        }
        Start-Sleep -Milliseconds 50
    }
    
    # Press Enter to go to next line
    [System.Windows.Forms.SendKeys]::SendWait(&quot;{ENTER}&quot;)
    
    # Wait before next line
    Start-Sleep -Milliseconds $delayPerLine
}

$totalElapsedSeconds = ((Get-Date) - $startTime).TotalSeconds

Write-Host &quot;&quot;
Write-Host &quot;========================================&quot; -ForegroundColor Green
Write-Host &quot;TYPING COMPLETED!&quot; -ForegroundColor Green
Write-Host &quot;========================================&quot; -ForegroundColor Green
Write-Host &quot;&quot;
Write-Host &quot;Summary:&quot; -ForegroundColor Yellow
Write-Host &quot;  Total lines typed: $lineNumber&quot; -ForegroundColor Yellow
Write-Host &quot;  Total time elapsed: $([math]::Round($totalElapsedSeconds / 60, 2)) minutes&quot; -ForegroundColor Yellow
Write-Host &quot;  Expected time: $TotalMinutes minutes&quot; -ForegroundColor Yellow
Write-Host &quot;&quot;

&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;This PowerShell script is a powerful tool for simulating slow typing in Windows. Whether you&#39;re creating training content, demonstrating code on remote desktops, or testing applications, it provides a flexible and easy-to-use solution.&lt;/p&gt;
</content><link rel='replies' type='application/atom+xml' href='http://sqlserverfreak.blogspot.com/feeds/2368834752300556069/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sqlserverfreak.blogspot.com/2026/04/simulate-slow-typing-with-powershell.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/2368834752300556069'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/2368834752300556069'/><link rel='alternate' type='text/html' href='http://sqlserverfreak.blogspot.com/2026/04/simulate-slow-typing-with-powershell.html' title=''/><author><name>SPK</name><uri>http://www.blogger.com/profile/07569889026692963359</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4468522590561210250.post-1338196575059797224</id><published>2025-11-25T08:48:00.000-08:00</published><updated>2025-11-25T08:52:39.577-08:00</updated><title type='text'>Setting Up a Standby Reporting Database in SQL Server Express</title><content type='html'>&lt;p&gt;&lt;/p&gt;
&lt;h1&gt;Objective and Setup&lt;/h1&gt;
&lt;p&gt;You want a read‑only reporting copy (&lt;code&gt;test_reporting&lt;/code&gt;) of a primary database (&lt;code&gt;test_prod&lt;/code&gt;) on the same SQL Server Express instance. You’ll periodically restore transaction log backups from &lt;code&gt;test_prod&lt;/code&gt; to &lt;code&gt;test_reporting&lt;/code&gt; so reporting users can query between restores. We’ll do this with &lt;strong&gt;RESTORE … WITH STANDBY&lt;/strong&gt;.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Prerequisites and Notes&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;SQL Server Express is fine; it lacks SQL Agent, so scheduling will be manual or via Windows Task Scheduler + &lt;code&gt;sqlcmd&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Ensure you have directories for data, log, backups, and the standby undo file:
&lt;ul&gt;
&lt;li&gt;Example paths:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;D:\Data&lt;/code&gt;, &lt;code&gt;E:\Logs&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;D:\Backups&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;D:\StandbyUndo&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;Use your actual drive letters/paths based on your server.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr /&gt;
&lt;h2&gt;Step 1: Create the &lt;code&gt;test_prod&lt;/code&gt; Database&lt;/h2&gt;
&lt;p&gt;Run in SSMS (or &lt;code&gt;sqlcmd&lt;/code&gt;):&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;-- Create test_prod with explicit file locations
CREATE DATABASE [test_prod]
ON PRIMARY (
    NAME = N&#39;test_prod_data&#39;,
    FILENAME = N&#39;D:\Data\test_prod.mdf&#39;,
    SIZE = 100MB, FILEGROWTH = 50MB
)
LOG ON (
    NAME = N&#39;test_prod_log&#39;,
    FILENAME = N&#39;E:\Logs\test_prod.ldf&#39;,
    SIZE = 64MB, FILEGROWTH = 32MB
);
GO

-- Set FULL recovery model to enable log backups
ALTER DATABASE [test_prod] SET RECOVERY FULL;
GO
&lt;/code&gt;&lt;/pre&gt;
&lt;hr /&gt;
&lt;h2&gt;Step 2: Seed Some Sample Data (Optional but Useful)&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;USE [test_prod];
GO

CREATE TABLE dbo.Sales (
    SalesId INT IDENTITY(1,1) PRIMARY KEY,
    OrderDate DATETIME2 NOT NULL DEFAULT SYSUTCDATETIME(),
    Customer NVARCHAR(100) NOT NULL,
    Amount DECIMAL(18,2) NOT NULL
);
GO

INSERT INTO dbo.Sales (Customer, Amount)
VALUES (N&#39;Acme Inc&#39;, 1250.00), (N&#39;Globex&#39;, 980.75), (N&#39;Initech&#39;, 212.00);
GO
&lt;/code&gt;&lt;/pre&gt;
&lt;hr /&gt;
&lt;h2&gt;Step 3: Take an Initial Full Backup of &lt;code&gt;test_prod&lt;/code&gt;&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;BACKUP DATABASE [test_prod]
TO DISK = N&#39;D:\Backups\test_prod_full_2025-11-25.bak&#39;
WITH INIT, CHECKSUM, STATS = 5;
GO
&lt;/code&gt;&lt;/pre&gt;
&lt;hr /&gt;
&lt;h2&gt;Step 4: Create the Reporting Database via Restore (NORECOVERY)&lt;/h2&gt;
&lt;p&gt;We’ll restore the full backup to a new database name (&lt;code&gt;test_reporting&lt;/code&gt;) and place files in separate locations.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;-- Restore full backup, leave database non-recovered (ready for logs)
RESTORE DATABASE [test_reporting]
FROM DISK = N&#39;D:\Backups\test_prod_full_2025-11-25.bak&#39;
WITH MOVE N&#39;test_prod_data&#39; TO N&#39;D:\Data\test_reporting.mdf&#39;,
     MOVE N&#39;test_prod_log&#39;  TO N&#39;E:\Logs\test_reporting.ldf&#39;,
     NORECOVERY, REPLACE, STATS = 5;
GO
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Note: If your logical file names differ, run this first to inspect and substitute names:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;RESTORE FILELISTONLY
FROM DISK = N&#39;D:\Backups\test_prod_full_2025-11-25.bak&#39;;
GO
&lt;/code&gt;&lt;/pre&gt;
&lt;hr /&gt;
&lt;h2&gt;Step 5: Take the First Transaction Log Backup from &lt;code&gt;test_prod&lt;/code&gt;&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;-- Make some changes (optional)
INSERT INTO dbo.Sales (Customer, Amount) VALUES (N&#39;Vector LLC&#39;, 333.33);
GO

-- Log backup
BACKUP LOG [test_prod]
TO DISK = N&#39;D:\Backups\test_prod_log_2025-11-25_1200.trn&#39;
WITH INIT, CHECKSUM, STATS = 5;
GO
&lt;/code&gt;&lt;/pre&gt;
&lt;hr /&gt;
&lt;h2&gt;Step 6: Apply the Log Backup to &lt;code&gt;test_reporting&lt;/code&gt; WITH STANDBY&lt;/h2&gt;
&lt;p&gt;Create an undo file path (used by SQL Server to roll back uncommitted transactions and keep the DB queryable):&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;RESTORE LOG [test_reporting]
FROM DISK = N&#39;D:\Backups\test_prod_log_2025-11-25_1200.trn&#39;
WITH STANDBY = N&#39;D:\StandbyUndo\test_reporting_undo.dat&#39;,
     STATS = 5;
GO
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Result: &lt;code&gt;test_reporting&lt;/code&gt; is now accessible read‑only for reporting.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Step 7: Periodically Update &lt;code&gt;test_reporting&lt;/code&gt; with New Log Backups&lt;/h2&gt;
&lt;p&gt;Repeat this cycle whenever you want to refresh reporting:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;-- On test_prod: make changes
INSERT INTO dbo.Sales (Customer, Amount) VALUES (N&#39;Wayne Enterprises&#39;, 9876.54);
GO

-- On test_prod: take a log backup
BACKUP LOG [test_prod]
TO DISK = N&#39;D:\Backups\test_prod_log_2025-11-25_1300.trn&#39;
WITH CHECKSUM, STATS = 5;
GO

-- On test_reporting: apply the new log WITH STANDBY (use the SAME undo file)
RESTORE LOG [test_reporting]
FROM DISK = N&#39;D:\Backups\test_prod_log_2025-11-25_1300.trn&#39;
WITH STANDBY = N&#39;D:\StandbyUndo\test_reporting_undo.dat&#39;,
     STATS = 5;
GO
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Keep using the same undo file path every time.&lt;/li&gt;
&lt;li&gt;Users can run read‑only queries between restores; connections are briefly interrupted while a restore runs.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr /&gt;
&lt;h2&gt;Step 8: Optional Actions&lt;/h2&gt;
&lt;h4&gt;Bring Reporting Fully Online (Ends the Chain)&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;RESTORE DATABASE [test_reporting] WITH RECOVERY;
GO
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;After this, you cannot apply further logs from the same chain.&lt;/p&gt;
&lt;h4&gt;Rerun the Setup from a New Full Backup&lt;/h4&gt;
&lt;p&gt;If you need to reinitialize, repeat Steps 3–6 starting with a fresh full backup.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Operational Guidance for SQL Server Express&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Use Windows Task Scheduler to run &lt;code&gt;sqlcmd&lt;/code&gt; for periodic restores:
&lt;ul&gt;
&lt;li&gt;Program: &lt;code&gt;sqlcmd&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Arguments:
&lt;pre&gt;&lt;code&gt;-S .\SQLEXPRESS -E -Q &quot;RESTORE LOG [test_reporting] 
FROM DISK = &#39;D:\Backups\test_prod_log_latest.trn&#39; 
WITH STANDBY = &#39;D:\StandbyUndo\test_reporting_undo.dat&#39;;&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;Keep your backup files timestamped and apply them strictly in chronological order.&lt;/li&gt;
&lt;li&gt;Don’t move or delete the undo file; it’s required for subsequent STANDBY restores.&lt;/li&gt;
&lt;li&gt;Advise report users about short maintenance windows during restores.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr /&gt;
&lt;h2&gt;Quick Verification Queries&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;-- On test_reporting: confirm read-only and recent data
SELECT TOP 10 * FROM dbo.Sales ORDER BY SalesId DESC;
GO

-- Check database state
SELECT name, state_desc, recovery_model_desc, is_read_only
FROM sys.databases
WHERE name IN (&#39;test_prod&#39;, &#39;test_reporting&#39;);
GO
&lt;/code&gt;&lt;/pre&gt;
&lt;hr /&gt;
&lt;h2&gt;Common Pitfalls and Fixes&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Missing or out‑of‑order log backup:&lt;/strong&gt; Ensure the log chain is continuous; reinitialize from a new full backup if broken.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Wrong logical file names in RESTORE MOVE:&lt;/strong&gt; Always confirm with &lt;code&gt;RESTORE FILELISTONLY&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Changing the undo file path or name:&lt;/strong&gt; Keep it consistent; changing it breaks the chain.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Long‑running queries during refresh:&lt;/strong&gt; Schedule log restores at predictable low‑usage times.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlserverfreak.blogspot.com/feeds/1338196575059797224/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sqlserverfreak.blogspot.com/2025/11/how-to-restore-database-in-standby-mode.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/1338196575059797224'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/1338196575059797224'/><link rel='alternate' type='text/html' href='http://sqlserverfreak.blogspot.com/2025/11/how-to-restore-database-in-standby-mode.html' title='Setting Up a Standby Reporting Database in SQL Server Express'/><author><name>SPK</name><uri>http://www.blogger.com/profile/07569889026692963359</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4468522590561210250.post-8699034731677663293</id><published>2025-08-26T07:22:00.000-07:00</published><updated>2025-08-26T07:22:07.265-07:00</updated><title type='text'>Extract and analyze deadlock events from SQL Server&#39;s system health extended event logs.</title><content type='html'>&lt;pre&gt;&lt;code&gt;
-- Step 1: Create a temporary table to store error log data
CREATE TABLE #errorlog (
    LogDate DATETIME,
    ProcessInfo VARCHAR(100),
    [Text] VARCHAR(MAX)
);

-- Step 2: Declare variables to extract log path
DECLARE @tag VARCHAR(MAX), @path VARCHAR(MAX);

-- Step 3: Populate the error log table using system stored procedure
INSERT INTO #errorlog EXEC sp_readerrorlog;

-- Step 4: Extract the log file path from the error log
SELECT @tag = [Text]
FROM #errorlog
WHERE [Text] LIKE &#39;Logging%MSSQL\Log%&#39;;

-- Step 5: Drop the temporary error log table
DROP TABLE #errorlog;

-- Step 6: Parse the log path from the extracted text
SET @path = SUBSTRING(@tag, 38, CHARINDEX(&#39;MSSQL\Log&#39;, @tag) - 29);

-- Step 7: Drop the #Deadlock table if it already exists
IF OBJECT_ID(&#39;#Deadlock&#39;) IS NOT NULL DROP TABLE #Deadlock;

-- Step 8: Read deadlock reports from the system health extended events file
SELECT  
    CONVERT(xml, event_data).query(&#39;/event/data/value/child::*&#39;) AS DeadlockReport,
    CONVERT(xml, event_data).value(&#39;(event[@name=&quot;xml_deadlock_report&quot;]/@timestamp)[1]&#39;, &#39;datetime&#39;) AS Execution_Time
INTO #Deadlock
FROM sys.fn_xe_file_target_read_file(@path + &#39;\system_health*.xel&#39;, NULL, NULL, NULL)
WHERE OBJECT_NAME LIKE &#39;xml_deadlock_report&#39;
  AND event_data LIKE &#39;%BNY_HF_6840_0008%&#39; -- Filter by database name
ORDER BY Execution_Time DESC;

-- Step 9: Retrieve the top 1000 deadlock events
SELECT TOP 1000 * 
FROM #Deadlock 
ORDER BY Execution_Time DESC;

-- Optional: Filter by specific time range
-- WHERE Execution_Time BETWEEN &#39;2021-09-18 05:00:00.000&#39; AND &#39;2021-09-20 05:00:00.000&#39;

&lt;/code&gt;&lt;/pre&gt;
</content><link rel='replies' type='application/atom+xml' href='http://sqlserverfreak.blogspot.com/feeds/8699034731677663293/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sqlserverfreak.blogspot.com/2025/08/extract-and-analyze-deadlock-events.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/8699034731677663293'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/8699034731677663293'/><link rel='alternate' type='text/html' href='http://sqlserverfreak.blogspot.com/2025/08/extract-and-analyze-deadlock-events.html' title='Extract and analyze deadlock events from SQL Server&#39;s system health extended event logs.'/><author><name>SPK</name><uri>http://www.blogger.com/profile/07569889026692963359</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4468522590561210250.post-5299855911461916592</id><published>2025-06-17T22:29:00.000-07:00</published><updated>2025-06-17T22:29:35.752-07:00</updated><title type='text'>MS SQL Server JSON Basics Cheat Sheet</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;span style=&quot;color: #1b1c1d; font-family: &amp;quot;Google Sans&amp;quot;; font-size: 15pt;&quot;&gt;MS SQL Server JSON Basics Cheat Sheet&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;border: none; line-height: 114%; margin-bottom: 12.0pt; mso-border-shadow: yes; mso-padding-alt: 31.0pt 31.0pt 31.0pt 31.0pt;&quot;&gt;&lt;span style=&quot;color: #1b1c1d; font-family: &amp;quot;Google Sans Text&amp;quot;; font-size: 12.0pt; line-height: 114%; mso-bidi-font-family: &amp;quot;Google Sans Text&amp;quot;; mso-fareast-font-family: &amp;quot;Google Sans Text&amp;quot;;&quot;&gt;This cheat sheet provides a quick reference for common functions
and syntax used to work with JSON data in Microsoft SQL Server (SQL Server 2016
and later).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;h3 style=&quot;line-height: 114%; margin-bottom: 6.0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;&quot;&gt;&lt;span style=&quot;color: #1b1c1d; font-family: &amp;quot;Google Sans&amp;quot;; font-size: 12.0pt; line-height: 114%; mso-bidi-font-family: &amp;quot;Google Sans&amp;quot;; mso-fareast-font-family: &amp;quot;Google Sans&amp;quot;;&quot;&gt;1. Validating JSON Text&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;border: none; line-height: 114%; margin-bottom: 12.0pt; mso-border-shadow: yes; mso-padding-alt: 31.0pt 31.0pt 31.0pt 31.0pt;&quot;&gt;&lt;span style=&quot;color: #1b1c1d; font-family: &amp;quot;Google Sans Text&amp;quot;; font-size: 12.0pt; line-height: 114%; mso-bidi-font-family: &amp;quot;Google Sans Text&amp;quot;; mso-fareast-font-family: &amp;quot;Google Sans Text&amp;quot;;&quot;&gt;Use ISJSON() to check if a string contains valid JSON. It
returns 1 for valid JSON, 0 for invalid JSON, and NULL if the input is NULL.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;border: none; line-height: 114%; margin-bottom: 12.0pt; mso-border-shadow: yes; mso-padding-alt: 31.0pt 31.0pt 31.0pt 31.0pt;&quot;&gt;&lt;span style=&quot;color: #1b1c1d; font-family: &amp;quot;Google Sans Text&amp;quot;; font-size: 12.0pt; line-height: 114%; mso-bidi-font-family: &amp;quot;Google Sans Text&amp;quot;; mso-fareast-font-family: &amp;quot;Google Sans Text&amp;quot;;&quot;&gt;-- Example Data&lt;br /&gt;
DECLARE @json_valid NVARCHAR(MAX) = N&#39;{&quot;name&quot;: &quot;John Doe&quot;,
&quot;age&quot;: 30}&#39;;&lt;br /&gt;
DECLARE @json_invalid NVARCHAR(MAX) = N&#39;{&quot;name&quot;: &quot;Jane
Doe&quot;, &quot;age&quot;: }&#39;; -- Invalid JSON&lt;br /&gt;
&lt;br /&gt;
-- Check Validity&lt;br /&gt;
SELECT ISJSON(@json_valid) AS IsValid1;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;-- Returns 1&lt;br /&gt;
SELECT ISJSON(@json_invalid) AS IsValid2;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;-- Returns 0&lt;br /&gt;
SELECT ISJSON(NULL) AS IsNullValid;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;-- Returns NULL&lt;br style=&quot;mso-special-character: line-break;&quot; /&gt;
&lt;!--[if !supportLineBreakNewLine]--&gt;&lt;br style=&quot;mso-special-character: line-break;&quot; /&gt;
&lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;h3 style=&quot;line-height: 114%; margin-bottom: 6.0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;&quot;&gt;&lt;span style=&quot;color: #1b1c1d; font-family: &amp;quot;Google Sans&amp;quot;; font-size: 12.0pt; line-height: 114%; mso-bidi-font-family: &amp;quot;Google Sans&amp;quot;; mso-fareast-font-family: &amp;quot;Google Sans&amp;quot;;&quot;&gt;2. Extracting Scalar Values&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;border: none; line-height: 114%; margin-bottom: 6.0pt; mso-border-shadow: yes; mso-padding-alt: 31.0pt 31.0pt 31.0pt 31.0pt;&quot;&gt;&lt;span style=&quot;color: #1b1c1d; font-family: &amp;quot;Google Sans Text&amp;quot;; font-size: 12.0pt; line-height: 114%; mso-bidi-font-family: &amp;quot;Google Sans Text&amp;quot;; mso-fareast-font-family: &amp;quot;Google Sans Text&amp;quot;;&quot;&gt;Use JSON_VALUE() to extract a single scalar value (string,
number, boolean) from a JSON string using a JSON path expression.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;border: none; line-height: 114%; margin-bottom: 6.0pt; margin-left: 23.25pt; margin-right: 0in; margin-top: 0in; mso-border-shadow: yes; mso-list: l2 level1 lfo1; mso-padding-alt: 31.0pt 31.0pt 31.0pt 31.0pt; text-indent: -.25in;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;●&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #1b1c1d; font-family: &amp;quot;Google Sans Text&amp;quot;; font-size: 12.0pt; line-height: 114%; mso-bidi-font-family: &amp;quot;Google Sans Text&amp;quot;; mso-fareast-font-family: &amp;quot;Google Sans Text&amp;quot;;&quot;&gt;Path Syntax:&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #1b1c1d; font-family: &amp;quot;Google Sans Text&amp;quot;; font-size: 12.0pt; line-height: 114%; mso-bidi-font-family: &amp;quot;Google Sans Text&amp;quot;; mso-fareast-font-family: &amp;quot;Google Sans Text&amp;quot;;&quot;&gt; $ represents the root
object. Use . for member access and [index] for array element access (0-based).&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;border: none; line-height: 114%; margin-bottom: 12.0pt; margin-left: 0in; margin-right: 0in; margin-top: 6.0pt; mso-border-shadow: yes; mso-padding-alt: 31.0pt 31.0pt 31.0pt 31.0pt;&quot;&gt;&lt;span style=&quot;color: #1b1c1d; font-family: &amp;quot;Google Sans Text&amp;quot;; font-size: 12.0pt; line-height: 114%; mso-bidi-font-family: &amp;quot;Google Sans Text&amp;quot;; mso-fareast-font-family: &amp;quot;Google Sans Text&amp;quot;;&quot;&gt;-- Example Data&lt;br /&gt;
DECLARE @json_data NVARCHAR(MAX) = N&#39;{&lt;br /&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;&quot;person&quot;: {&lt;br /&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&quot;name&quot;: &quot;Alice&quot;,&lt;br /&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&quot;age&quot;: 28,&lt;br /&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&quot;isStudent&quot;: false,&lt;br /&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&quot;address&quot;: {&lt;br /&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&quot;street&quot;: &quot;123 Main
St&quot;,&lt;br /&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&quot;city&quot;:
&quot;Anytown&quot;&lt;br /&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;},&lt;br /&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&quot;courses&quot;:
[&quot;Math&quot;, &quot;History&quot;]&lt;br /&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;}&lt;br /&gt;
}&#39;;&lt;br /&gt;
&lt;br /&gt;
-- Extract Scalar Values&lt;br /&gt;
SELECT&lt;br /&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;JSON_VALUE(@json_data,
&#39;$.person.name&#39;) AS PersonName,&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;--
Returns &#39;Alice&#39;&lt;br /&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;JSON_VALUE(@json_data,
&#39;$.person.age&#39;) AS PersonAge,&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;--
Returns &#39;28&#39; (as string by default)&lt;br /&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;JSON_VALUE(@json_data,
&#39;$.person.isStudent&#39;) AS IsStudent,&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;--
Returns &#39;false&#39;&lt;br /&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;JSON_VALUE(@json_data,
&#39;$.person.address.city&#39;) AS City,&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;--
Returns &#39;Anytown&#39;&lt;br /&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;JSON_VALUE(@json_data,
&#39;$.person.courses[0]&#39;) AS FirstCourse; -- Returns &#39;Math&#39;&lt;br /&gt;
&lt;br /&gt;
-- Extract with specific data type (using CAST/CONVERT)&lt;br /&gt;
SELECT&lt;br /&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;CAST(JSON_VALUE(@json_data,
&#39;$.person.age&#39;) AS INT) AS PersonAgeInt,&lt;br /&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;CAST(JSON_VALUE(@json_data,
&#39;$.person.isStudent&#39;) AS BIT) AS IsStudentBit;&lt;br style=&quot;mso-special-character: line-break;&quot; /&gt;
&lt;!--[if !supportLineBreakNewLine]--&gt;&lt;br style=&quot;mso-special-character: line-break;&quot; /&gt;
&lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;h3 style=&quot;line-height: 114%; margin-bottom: 6.0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;&quot;&gt;&lt;span style=&quot;color: #1b1c1d; font-family: &amp;quot;Google Sans&amp;quot;; font-size: 12.0pt; line-height: 114%; mso-bidi-font-family: &amp;quot;Google Sans&amp;quot;; mso-fareast-font-family: &amp;quot;Google Sans&amp;quot;;&quot;&gt;3. Extracting Objects or Arrays&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;border: none; line-height: 114%; margin-bottom: 12.0pt; mso-border-shadow: yes; mso-padding-alt: 31.0pt 31.0pt 31.0pt 31.0pt;&quot;&gt;&lt;span style=&quot;color: #1b1c1d; font-family: &amp;quot;Google Sans Text&amp;quot;; font-size: 12.0pt; line-height: 114%; mso-bidi-font-family: &amp;quot;Google Sans Text&amp;quot;; mso-fareast-font-family: &amp;quot;Google Sans Text&amp;quot;;&quot;&gt;Use JSON_QUERY() to extract an object or an array from a JSON
string. JSON_VALUE returns NULL if it targets an object or array.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;border: none; line-height: 114%; margin-bottom: 12.0pt; mso-border-shadow: yes; mso-padding-alt: 31.0pt 31.0pt 31.0pt 31.0pt;&quot;&gt;&lt;span style=&quot;color: #1b1c1d; font-family: &amp;quot;Google Sans Text&amp;quot;; font-size: 12.0pt; line-height: 114%; mso-bidi-font-family: &amp;quot;Google Sans Text&amp;quot;; mso-fareast-font-family: &amp;quot;Google Sans Text&amp;quot;;&quot;&gt;-- Example Data (using @json_data from above)&lt;br /&gt;
&lt;br /&gt;
-- Extract Object&lt;br /&gt;
SELECT JSON_QUERY(@json_data, &#39;$.person.address&#39;) AS AddressObject;&lt;br /&gt;
-- Returns: {&quot;street&quot;: &quot;123 Main St&quot;, &quot;city&quot;:
&quot;Anytown&quot;}&lt;br /&gt;
&lt;br /&gt;
-- Extract Array&lt;br /&gt;
SELECT JSON_QUERY(@json_data, &#39;$.person.courses&#39;) AS CoursesArray;&lt;br /&gt;
-- Returns: [&quot;Math&quot;, &quot;History&quot;]&lt;br /&gt;
&lt;br /&gt;
-- Extracting an object/array with JSON_VALUE returns NULL&lt;br /&gt;
SELECT JSON_VALUE(@json_data, &#39;$.person.address&#39;) AS AddressValueIsNull; --
Returns NULL&lt;br style=&quot;mso-special-character: line-break;&quot; /&gt;
&lt;!--[if !supportLineBreakNewLine]--&gt;&lt;br style=&quot;mso-special-character: line-break;&quot; /&gt;
&lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;h3 style=&quot;line-height: 114%; margin-bottom: 6.0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;&quot;&gt;&lt;span style=&quot;color: #1b1c1d; font-family: &amp;quot;Google Sans&amp;quot;; font-size: 12.0pt; line-height: 114%; mso-bidi-font-family: &amp;quot;Google Sans&amp;quot;; mso-fareast-font-family: &amp;quot;Google Sans&amp;quot;;&quot;&gt;4. Modifying JSON Data&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;border: none; line-height: 114%; margin-bottom: 6.0pt; mso-border-shadow: yes; mso-padding-alt: 31.0pt 31.0pt 31.0pt 31.0pt;&quot;&gt;&lt;span style=&quot;color: #1b1c1d; font-family: &amp;quot;Google Sans Text&amp;quot;; font-size: 12.0pt; line-height: 114%; mso-bidi-font-family: &amp;quot;Google Sans Text&amp;quot;; mso-fareast-font-family: &amp;quot;Google Sans Text&amp;quot;;&quot;&gt;Use JSON_MODIFY() to update a property value, insert a new
property, or delete a property within a JSON string. It returns the &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;modified&lt;/i&gt; JSON string.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;border: none; line-height: 114%; margin-left: 23.25pt; mso-border-shadow: yes; mso-list: l3 level1 lfo2; mso-padding-alt: 31.0pt 31.0pt 31.0pt 31.0pt; text-indent: -.25in;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;●&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #1b1c1d; font-family: &amp;quot;Google Sans Text&amp;quot;; font-size: 12.0pt; line-height: 114%; mso-bidi-font-family: &amp;quot;Google Sans Text&amp;quot;; mso-fareast-font-family: &amp;quot;Google Sans Text&amp;quot;;&quot;&gt;Path Syntax:&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #1b1c1d; font-family: &amp;quot;Google Sans Text&amp;quot;; font-size: 12.0pt; line-height: 114%; mso-bidi-font-family: &amp;quot;Google Sans Text&amp;quot;; mso-fareast-font-family: &amp;quot;Google Sans Text&amp;quot;;&quot;&gt; Same as JSON_VALUE and
JSON_QUERY.&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;border: none; line-height: 114%; margin-left: 23.25pt; mso-border-shadow: yes; mso-list: l3 level1 lfo2; mso-padding-alt: 31.0pt 31.0pt 31.0pt 31.0pt; text-indent: -.25in;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;●&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #1b1c1d; font-family: &amp;quot;Google Sans Text&amp;quot;; font-size: 12.0pt; line-height: 114%; mso-bidi-font-family: &amp;quot;Google Sans Text&amp;quot;; mso-fareast-font-family: &amp;quot;Google Sans Text&amp;quot;;&quot;&gt;append keyword:&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #1b1c1d; font-family: &amp;quot;Google Sans Text&amp;quot;; font-size: 12.0pt; line-height: 114%; mso-bidi-font-family: &amp;quot;Google Sans Text&amp;quot;; mso-fareast-font-family: &amp;quot;Google Sans Text&amp;quot;;&quot;&gt; Adds an element to the
end of an array.&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;border: none; line-height: 114%; margin-left: 23.25pt; mso-border-shadow: yes; mso-list: l3 level1 lfo2; mso-padding-alt: 31.0pt 31.0pt 31.0pt 31.0pt; text-indent: -.25in;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;●&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #1b1c1d; font-family: &amp;quot;Google Sans Text&amp;quot;; font-size: 12.0pt; line-height: 114%; mso-bidi-font-family: &amp;quot;Google Sans Text&amp;quot;; mso-fareast-font-family: &amp;quot;Google Sans Text&amp;quot;;&quot;&gt;lax mode (default):&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #1b1c1d; font-family: &amp;quot;Google Sans Text&amp;quot;; font-size: 12.0pt; line-height: 114%; mso-bidi-font-family: &amp;quot;Google Sans Text&amp;quot;; mso-fareast-font-family: &amp;quot;Google Sans Text&amp;quot;;&quot;&gt; If the path doesn&#39;t
exist for an update/delete, it doesn&#39;t raise an error.&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;border: none; line-height: 114%; margin-bottom: 6.0pt; margin-left: 23.25pt; margin-right: 0in; margin-top: 0in; mso-border-shadow: yes; mso-list: l3 level1 lfo2; mso-padding-alt: 31.0pt 31.0pt 31.0pt 31.0pt; text-indent: -.25in;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;●&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #1b1c1d; font-family: &amp;quot;Google Sans Text&amp;quot;; font-size: 12.0pt; line-height: 114%; mso-bidi-font-family: &amp;quot;Google Sans Text&amp;quot;; mso-fareast-font-family: &amp;quot;Google Sans Text&amp;quot;;&quot;&gt;strict mode:&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #1b1c1d; font-family: &amp;quot;Google Sans Text&amp;quot;; font-size: 12.0pt; line-height: 114%; mso-bidi-font-family: &amp;quot;Google Sans Text&amp;quot;; mso-fareast-font-family: &amp;quot;Google Sans Text&amp;quot;;&quot;&gt; If the path doesn&#39;t
exist for an update/delete, it raises an error.&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;border: none; line-height: 114%; margin-bottom: 12.0pt; margin-left: 0in; margin-right: 0in; margin-top: 6.0pt; mso-border-shadow: yes; mso-padding-alt: 31.0pt 31.0pt 31.0pt 31.0pt;&quot;&gt;&lt;span style=&quot;color: #1b1c1d; font-family: &amp;quot;Google Sans Text&amp;quot;; font-size: 12.0pt; line-height: 114%; mso-bidi-font-family: &amp;quot;Google Sans Text&amp;quot;; mso-fareast-font-family: &amp;quot;Google Sans Text&amp;quot;;&quot;&gt;-- Example Data&lt;br /&gt;
DECLARE @json_doc NVARCHAR(MAX) = N&#39;{&quot;name&quot;: &quot;Bob&quot;,
&quot;age&quot;: 35, &quot;skills&quot;: [&quot;SQL&quot;]}&#39;;&lt;br /&gt;
&lt;br /&gt;
-- Update existing value&lt;br /&gt;
SET @json_doc = JSON_MODIFY(@json_doc, &#39;$.age&#39;, 36);&lt;br /&gt;
-- @json_doc is now: {&quot;name&quot;: &quot;Bob&quot;, &quot;age&quot;: 36,
&quot;skills&quot;: [&quot;SQL&quot;]}&lt;br /&gt;
&lt;br /&gt;
-- Insert new key/value pair&lt;br /&gt;
SET @json_doc = JSON_MODIFY(@json_doc, &#39;$.city&#39;, &#39;New York&#39;);&lt;br /&gt;
-- @json_doc is now: {&quot;name&quot;: &quot;Bob&quot;, &quot;age&quot;: 36,
&quot;skills&quot;: [&quot;SQL&quot;], &quot;city&quot;: &quot;New York&quot;}&lt;br /&gt;
&lt;br /&gt;
-- Append to an array&lt;br /&gt;
SET @json_doc = JSON_MODIFY(@json_doc, &#39;append $.skills&#39;, &#39;JSON&#39;);&lt;br /&gt;
-- @json_doc is now: {&quot;name&quot;: &quot;Bob&quot;, &quot;age&quot;: 36,
&quot;skills&quot;: [&quot;SQL&quot;, &quot;JSON&quot;], &quot;city&quot;:
&quot;New York&quot;}&lt;br /&gt;
&lt;br /&gt;
-- Delete a key/value pair (set value to NULL)&lt;br /&gt;
SET @json_doc = JSON_MODIFY(@json_doc, &#39;$.city&#39;, NULL);&lt;br /&gt;
-- @json_doc is now: {&quot;name&quot;: &quot;Bob&quot;, &quot;age&quot;: 36,
&quot;skills&quot;: [&quot;SQL&quot;, &quot;JSON&quot;]}&lt;br /&gt;
&lt;br /&gt;
SELECT @json_doc AS ModifiedJson;&lt;br style=&quot;mso-special-character: line-break;&quot; /&gt;
&lt;!--[if !supportLineBreakNewLine]--&gt;&lt;br style=&quot;mso-special-character: line-break;&quot; /&gt;
&lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;h3 style=&quot;line-height: 114%; margin-bottom: 6.0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;&quot;&gt;&lt;span style=&quot;color: #1b1c1d; font-family: &amp;quot;Google Sans&amp;quot;; font-size: 12.0pt; line-height: 114%; mso-bidi-font-family: &amp;quot;Google Sans&amp;quot;; mso-fareast-font-family: &amp;quot;Google Sans&amp;quot;;&quot;&gt;5. Parsing JSON into Rows and Columns&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;border: none; line-height: 114%; margin-bottom: 6.0pt; mso-border-shadow: yes; mso-padding-alt: 31.0pt 31.0pt 31.0pt 31.0pt;&quot;&gt;&lt;span style=&quot;color: #1b1c1d; font-family: &amp;quot;Google Sans Text&amp;quot;; font-size: 12.0pt; line-height: 114%; mso-bidi-font-family: &amp;quot;Google Sans Text&amp;quot;; mso-fareast-font-family: &amp;quot;Google Sans Text&amp;quot;;&quot;&gt;Use OPENJSON() to parse JSON text and return objects and
properties as rows and columns. It&#39;s often used with a WITH clause to define
the output schema.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;border: none; line-height: 114%; margin-left: 23.25pt; mso-border-shadow: yes; mso-list: l1 level1 lfo3; mso-padding-alt: 31.0pt 31.0pt 31.0pt 31.0pt; text-indent: -.25in;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;●&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #1b1c1d; font-family: &amp;quot;Google Sans Text&amp;quot;; font-size: 12.0pt; line-height: 114%; mso-bidi-font-family: &amp;quot;Google Sans Text&amp;quot;; mso-fareast-font-family: &amp;quot;Google Sans Text&amp;quot;;&quot;&gt;Default Schema:&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #1b1c1d; font-family: &amp;quot;Google Sans Text&amp;quot;; font-size: 12.0pt; line-height: 114%; mso-bidi-font-family: &amp;quot;Google Sans Text&amp;quot;; mso-fareast-font-family: &amp;quot;Google Sans Text&amp;quot;;&quot;&gt; Returns key/value pairs
and type information.&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;border: none; line-height: 114%; margin-bottom: 6.0pt; margin-left: 23.25pt; margin-right: 0in; margin-top: 0in; mso-border-shadow: yes; mso-list: l1 level1 lfo3; mso-padding-alt: 31.0pt 31.0pt 31.0pt 31.0pt; text-indent: -.25in;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;●&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #1b1c1d; font-family: &amp;quot;Google Sans Text&amp;quot;; font-size: 12.0pt; line-height: 114%; mso-bidi-font-family: &amp;quot;Google Sans Text&amp;quot;; mso-fareast-font-family: &amp;quot;Google Sans Text&amp;quot;;&quot;&gt;Explicit Schema (WITH clause):&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #1b1c1d; font-family: &amp;quot;Google Sans Text&amp;quot;; font-size: 12.0pt; line-height: 114%; mso-bidi-font-family: &amp;quot;Google Sans Text&amp;quot;; mso-fareast-font-family: &amp;quot;Google Sans Text&amp;quot;;&quot;&gt;
Defines columns and their data types, mapping them to JSON properties using
JSON paths.&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;border: none; line-height: 114%; margin-bottom: 12.0pt; margin-left: 0in; margin-right: 0in; margin-top: 6.0pt; mso-border-shadow: yes; mso-padding-alt: 31.0pt 31.0pt 31.0pt 31.0pt;&quot;&gt;&lt;span style=&quot;color: #1b1c1d; font-family: &amp;quot;Google Sans Text&amp;quot;; font-size: 12.0pt; line-height: 114%; mso-bidi-font-family: &amp;quot;Google Sans Text&amp;quot;; mso-fareast-font-family: &amp;quot;Google Sans Text&amp;quot;;&quot;&gt;-- Example Data&lt;br /&gt;
DECLARE @json_array NVARCHAR(MAX) = N&#39;[&lt;br /&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;{&quot;id&quot;: 1, &quot;name&quot;:
&quot;Product A&quot;, &quot;price&quot;: 10.50},&lt;br /&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;{&quot;id&quot;: 2, &quot;name&quot;:
&quot;Product B&quot;, &quot;price&quot;: 25.00, &quot;tags&quot;:
[&quot;tech&quot;, &quot;gadget&quot;]},&lt;br /&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;{&quot;id&quot;: 3, &quot;name&quot;:
&quot;Product C&quot;, &quot;price&quot;: 5.75}&lt;br /&gt;
]&#39;;&lt;br /&gt;
&lt;br /&gt;
-- Using OPENJSON with Default Schema&lt;br /&gt;
SELECT [key], [value], [type]&lt;br /&gt;
FROM OPENJSON(@json_array);&lt;br /&gt;
/* Returns rows representing each object in the array:&lt;br /&gt;
key | value&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;| type&lt;br /&gt;
----|-----------------------------------------------------------|------&lt;br /&gt;
0&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;| {&quot;id&quot;: 1,
&quot;name&quot;: &quot;Product A&quot;, &quot;price&quot;: 10.50}&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;| 5 (Object)&lt;br /&gt;
1&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;| {&quot;id&quot;: 2,
&quot;name&quot;: &quot;Product B&quot;, &quot;price&quot;: 25.00,
&quot;tags&quot;:...}| 5 (Object)&lt;br /&gt;
2&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;| {&quot;id&quot;: 3,
&quot;name&quot;: &quot;Product C&quot;, &quot;price&quot;: 5.75}&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;| 5 (Object)&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
-- Using OPENJSON with Explicit Schema (WITH clause)&lt;br /&gt;
SELECT *&lt;br /&gt;
FROM OPENJSON(@json_array)&lt;br /&gt;
WITH (&lt;br /&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;ProductID INT &#39;$.id&#39;,&lt;br /&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;ProductName VARCHAR(100) &#39;$.name&#39;,&lt;br /&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Price DECIMAL(10, 2) &#39;$.price&#39;,&lt;br /&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Tags NVARCHAR(MAX) &#39;$.tags&#39; AS JSON
-- Keep nested array as JSON&lt;br /&gt;
);&lt;br /&gt;
/* Returns:&lt;br /&gt;
ProductID | ProductName | Price | Tags&lt;br /&gt;
----------|-------------|-------|---------------------&lt;br /&gt;
1&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;| Product A&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;| 10.50 | NULL&lt;br /&gt;
2&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;| Product B&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;| 25.00 | [&quot;tech&quot;,
&quot;gadget&quot;]&lt;br /&gt;
3&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;| Product C&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;| 5.75&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;
&lt;/span&gt;| NULL&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
-- Accessing nested arrays within OPENJSON&lt;br /&gt;
DECLARE @json_single_obj NVARCHAR(MAX) = N&#39;{&lt;br /&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;&quot;orderId&quot;: 101,&lt;br /&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;&quot;customer&quot;: &quot;Jane
Smith&quot;,&lt;br /&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;&quot;items&quot;: [&lt;br /&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&quot;sku&quot;: &quot;X1&quot;,
&quot;qty&quot;: 2},&lt;br /&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&quot;sku&quot;: &quot;Y2&quot;,
&quot;qty&quot;: 1}&lt;br /&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;]&lt;br /&gt;
}&#39;;&lt;br /&gt;
&lt;br /&gt;
SELECT i.*&lt;br /&gt;
FROM OPENJSON(@json_single_obj, &#39;$.items&#39;) -- Specify the path to the array&lt;br /&gt;
WITH (&lt;br /&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;SKU VARCHAR(10) &#39;$.sku&#39;,&lt;br /&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Quantity INT &#39;$.qty&#39;&lt;br /&gt;
) AS i;&lt;br /&gt;
/* Returns:&lt;br /&gt;
SKU | Quantity&lt;br /&gt;
----|----------&lt;br /&gt;
X1&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;| 2&lt;br /&gt;
Y2&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;| 1&lt;br /&gt;
*/&lt;br style=&quot;mso-special-character: line-break;&quot; /&gt;
&lt;!--[if !supportLineBreakNewLine]--&gt;&lt;br style=&quot;mso-special-character: line-break;&quot; /&gt;
&lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;h3 style=&quot;line-height: 114%; margin-bottom: 6.0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;&quot;&gt;&lt;span style=&quot;color: #1b1c1d; font-family: &amp;quot;Google Sans&amp;quot;; font-size: 12.0pt; line-height: 114%; mso-bidi-font-family: &amp;quot;Google Sans&amp;quot;; mso-fareast-font-family: &amp;quot;Google Sans&amp;quot;;&quot;&gt;6. Formatting T-SQL Results as JSON&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;border: none; line-height: 114%; margin-bottom: 6.0pt; mso-border-shadow: yes; mso-padding-alt: 31.0pt 31.0pt 31.0pt 31.0pt;&quot;&gt;&lt;span style=&quot;color: #1b1c1d; font-family: &amp;quot;Google Sans Text&amp;quot;; font-size: 12.0pt; line-height: 114%; mso-bidi-font-family: &amp;quot;Google Sans Text&amp;quot;; mso-fareast-font-family: &amp;quot;Google Sans Text&amp;quot;;&quot;&gt;Use FOR JSON to format query results as JSON text.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;border: none; line-height: 114%; margin-left: 23.25pt; mso-border-shadow: yes; mso-list: l0 level1 lfo4; mso-padding-alt: 31.0pt 31.0pt 31.0pt 31.0pt; text-indent: -.25in;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;●&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #1b1c1d; font-family: &amp;quot;Google Sans Text&amp;quot;; font-size: 12.0pt; line-height: 114%; mso-bidi-font-family: &amp;quot;Google Sans Text&amp;quot;; mso-fareast-font-family: &amp;quot;Google Sans Text&amp;quot;;&quot;&gt;FOR JSON PATH:&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #1b1c1d; font-family: &amp;quot;Google Sans Text&amp;quot;; font-size: 12.0pt; line-height: 114%; mso-bidi-font-family: &amp;quot;Google Sans Text&amp;quot;; mso-fareast-font-family: &amp;quot;Google Sans Text&amp;quot;;&quot;&gt; Gives you full control
over the output format using dot notation in column aliases. Nested structures
are created based on these aliases.&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;border: none; line-height: 114%; margin-bottom: 6.0pt; margin-left: 23.25pt; margin-right: 0in; margin-top: 0in; mso-border-shadow: yes; mso-list: l0 level1 lfo4; mso-padding-alt: 31.0pt 31.0pt 31.0pt 31.0pt; text-indent: -.25in;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;●&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #1b1c1d; font-family: &amp;quot;Google Sans Text&amp;quot;; font-size: 12.0pt; line-height: 114%; mso-bidi-font-family: &amp;quot;Google Sans Text&amp;quot;; mso-fareast-font-family: &amp;quot;Google Sans Text&amp;quot;;&quot;&gt;FOR JSON AUTO:&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #1b1c1d; font-family: &amp;quot;Google Sans Text&amp;quot;; font-size: 12.0pt; line-height: 114%; mso-bidi-font-family: &amp;quot;Google Sans Text&amp;quot;; mso-fareast-font-family: &amp;quot;Google Sans Text&amp;quot;;&quot;&gt; Automatically creates
nested JSON structures based on the table structure in the SELECT statement and
the order of columns.&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;border: none; line-height: 114%; margin-bottom: 12.0pt; margin-left: 0in; margin-right: 0in; margin-top: 6.0pt; mso-border-shadow: yes; mso-padding-alt: 31.0pt 31.0pt 31.0pt 31.0pt;&quot;&gt;&lt;span style=&quot;color: #1b1c1d; font-family: &amp;quot;Google Sans Text&amp;quot;; font-size: 12.0pt; line-height: 114%; mso-bidi-font-family: &amp;quot;Google Sans Text&amp;quot;; mso-fareast-font-family: &amp;quot;Google Sans Text&amp;quot;;&quot;&gt;-- Example Table Data
(Assume a table named &#39;Employees&#39;)&lt;br /&gt;
-- EmployeeID | FirstName | LastName | Department | ManagerID&lt;br /&gt;
-- -----------|-----------|----------|------------|-----------&lt;br /&gt;
-- 1&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;| John&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;| Doe&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;| Sales&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;| NULL&lt;br /&gt;
-- 2&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;| Jane&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;| Smith&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;| HR&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;| 1&lt;br /&gt;
-- 3&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;| Peter&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;| Jones&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;| Sales&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;| 1&lt;br /&gt;
&lt;br /&gt;
-- Using FOR JSON PATH&lt;br /&gt;
SELECT&lt;br /&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;EmployeeID AS &#39;employee.id&#39;,&lt;br /&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;FirstName AS &#39;employee.firstName&#39;,&lt;br /&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;LastName AS &#39;employee.lastName&#39;,&lt;br /&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Department AS &#39;employee.dept&#39;&lt;br /&gt;
FROM Employees&lt;br /&gt;
WHERE EmployeeID = 1&lt;br /&gt;
FOR JSON PATH, ROOT(&#39;employees&#39;); -- ROOT adds a root element&lt;br /&gt;
-- Returns: {&quot;employees&quot;:[{&quot;employee&quot;:{&quot;id&quot;:1,&quot;firstName&quot;:&quot;John&quot;,&quot;lastName&quot;:&quot;Doe&quot;,&quot;dept&quot;:&quot;Sales&quot;}}]}&lt;br /&gt;
&lt;br /&gt;
-- Using FOR JSON AUTO&lt;br /&gt;
SELECT&lt;br /&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;EmployeeID,&lt;br /&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;FirstName,&lt;br /&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;LastName,&lt;br /&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Department&lt;br /&gt;
FROM Employees&lt;br /&gt;
WHERE Department = &#39;Sales&#39;&lt;br /&gt;
FOR JSON AUTO;&lt;br /&gt;
-- Returns:
[{&quot;EmployeeID&quot;:1,&quot;FirstName&quot;:&quot;John&quot;,&quot;LastName&quot;:&quot;Doe&quot;,&quot;Department&quot;:&quot;Sales&quot;},{&quot;EmployeeID&quot;:3,&quot;FirstName&quot;:&quot;Peter&quot;,&quot;LastName&quot;:&quot;Jones&quot;,&quot;Department&quot;:&quot;Sales&quot;}]&lt;br /&gt;
&lt;br /&gt;
-- FOR JSON PATH with Nested Structure&lt;br /&gt;
SELECT&lt;br /&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;e.EmployeeID AS &#39;id&#39;,&lt;br /&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;e.FirstName AS &#39;name.first&#39;,&lt;br /&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;e.LastName AS &#39;name.last&#39;,&lt;br /&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;(SELECT m.FirstName + &#39; &#39; +
m.LastName&lt;br /&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;FROM Employees m&lt;br /&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;WHERE m.EmployeeID = e.ManagerID) AS
&#39;managerName&#39;&lt;br /&gt;
FROM Employees e&lt;br /&gt;
WHERE e.EmployeeID = 2&lt;br /&gt;
FOR JSON PATH, WITHOUT_ARRAY_WRAPPER; -- WITHOUT_ARRAY_WRAPPER removes the
outer [] for single results&lt;br /&gt;
-- Returns:
{&quot;id&quot;:2,&quot;name&quot;:{&quot;first&quot;:&quot;Jane&quot;,&quot;last&quot;:&quot;Smith&quot;},&quot;managerName&quot;:&quot;John
Doe&quot;}&lt;br style=&quot;mso-special-character: line-break;&quot; /&gt;
&lt;!--[if !supportLineBreakNewLine]--&gt;&lt;br style=&quot;mso-special-character: line-break;&quot; /&gt;
&lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;border: none; line-height: 114%; margin-bottom: 12.0pt; mso-border-shadow: yes; mso-padding-alt: 31.0pt 31.0pt 31.0pt 31.0pt;&quot;&gt;&lt;span style=&quot;color: #1b1c1d; font-family: &amp;quot;Google Sans Text&amp;quot;; font-size: 12.0pt; line-height: 114%; mso-bidi-font-family: &amp;quot;Google Sans Text&amp;quot;; mso-fareast-font-family: &amp;quot;Google Sans Text&amp;quot;;&quot;&gt;This cheat sheet covers the fundamental JSON functions in SQL
Server. Remember to consult the official Microsoft documentation for more
advanced features and options.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/5299855911461916592'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/5299855911461916592'/><link rel='alternate' type='text/html' href='http://sqlserverfreak.blogspot.com/2025/06/ms-sql-server-json-basics-cheat-sheet.html' title='MS SQL Server JSON Basics Cheat Sheet'/><author><name>SPK</name><uri>http://www.blogger.com/profile/07569889026692963359</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-4468522590561210250.post-5975725115117526770</id><published>2023-08-07T04:53:00.006-07:00</published><updated>2023-08-07T04:53:37.237-07:00</updated><title type='text'>Performance Tuning SQL Server Queries: Boosting Efficiency and Speed</title><content type='html'>&lt;p&gt;Introduction:&lt;/p&gt;&lt;p&gt;In the realm of SQL Server database administration, performance tuning plays a pivotal role in enhancing the efficiency and speed of queries. As the volume of data grows and application demands increase, optimizing the execution of queries becomes critical to maintain the overall system performance. This article delves into the fundamental aspects of performance tuning for SQL Server queries, exploring techniques to identify bottlenecks and implement optimizations for optimal query performance.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;1. Understanding Query Execution Plan:&lt;/p&gt;&lt;p&gt;The query execution plan serves as a roadmap to understanding how SQL Server processes a query. By analyzing the execution plan, administrators can identify potential performance issues and determine the most efficient way to execute a query. We will discuss the use of SQL Server Management Studio (SSMS) and dynamic management views (DMVs) to obtain query execution plans and analyze them.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;2. Indexing Strategies:&lt;/p&gt;&lt;p&gt;Appropriate indexing is one of the most powerful tools for optimizing query performance. We&#39;ll explore various indexing strategies, including clustered, non-clustered, and covering indexes, as well as their impact on query execution. Additionally, we&#39;ll delve into common indexing pitfalls and best practices to ensure the right indexes are created for your workload.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;3. Query Optimization Techniques:&lt;/p&gt;&lt;p&gt;In this section, we&#39;ll explore a range of query optimization techniques, such as JOIN optimization, subquery optimization, and using appropriate SQL Server functions efficiently. We&#39;ll also discuss how to leverage query hints and plan guides to influence the execution plan when needed, though caution must be exercised when using these features.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;4. Query Rewriting and Refactoring:&lt;/p&gt;&lt;p&gt;Sometimes, rewriting or refactoring a query can lead to significant performance gains. We&#39;ll discuss common SQL coding patterns that can be improved and explore how to rewrite complex queries into simpler and more efficient forms. Additionally, we&#39;ll cover the importance of avoiding correlated subqueries and employing CTEs (Common Table Expressions) for better query performance.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;5. Temporal and Cached Data:&lt;/p&gt;&lt;p&gt;Caching query results and employing temporal tables can improve performance significantly by reducing the load on the database server. We&#39;ll delve into techniques for caching data, both at the application level and within SQL Server itself, to reduce query execution times and improve overall user experience.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;6. Monitoring and Profiling:&lt;/p&gt;&lt;p&gt;To ensure ongoing performance optimization, monitoring and profiling queries are essential. We&#39;ll explore SQL Server&#39;s built-in tools, such as SQL Server Profiler and Extended Events, to capture query performance data. Additionally, we&#39;ll discuss how to leverage performance monitoring tools like SQL Server Performance Monitor to analyze resource utilization and identify performance bottlenecks.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Conclusion:&lt;/p&gt;&lt;p&gt;Performance tuning of SQL Server queries is a continuous process that requires a comprehensive understanding of the database structure, indexing strategies, and query execution plans. By implementing the techniques discussed in this article, you can significantly improve the efficiency and speed of your queries, resulting in better application performance and a more positive user experience. Remember to analyze the impact of any changes thoroughly and continuously monitor your system to ensure long-term success in performance optimization.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlserverfreak.blogspot.com/feeds/5975725115117526770/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sqlserverfreak.blogspot.com/2023/08/performance-tuning-sql-server-queries.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/5975725115117526770'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/5975725115117526770'/><link rel='alternate' type='text/html' href='http://sqlserverfreak.blogspot.com/2023/08/performance-tuning-sql-server-queries.html' title='Performance Tuning SQL Server Queries: Boosting Efficiency and Speed'/><author><name>SPK</name><uri>http://www.blogger.com/profile/07569889026692963359</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4468522590561210250.post-7424288237110654362</id><published>2021-05-23T00:33:00.006-07:00</published><updated>2021-05-23T00:33:58.304-07:00</updated><title type='text'>SQL Server with Python - An Intro</title><content type='html'>&lt;p&gt;&lt;span style=&quot;background-color: white; color: #292929; font-family: charter, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 21px; letter-spacing: -0.003em;&quot;&gt;Everyone uses SQL, and everyone uses Python. SQL is the de-facto standard for databases. Python on the other hand is an all-star, a top language for data analytics, machine learning, and web development. Imagine both, together.&lt;/span&gt;&lt;/p&gt;&lt;section class=&quot;ge gf gg du gh&quot; style=&quot;background-color: white; box-sizing: inherit; color: rgba(0, 0, 0, 0.8); font-family: medium-content-sans-serif-font, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;div class=&quot;n p&quot; style=&quot;box-sizing: inherit; display: flex; justify-content: center;&quot;&gt;&lt;div class=&quot;au av aw ax ay gi ba v&quot; style=&quot;box-sizing: inherit; margin: 0px 64px; max-width: 680px; min-width: 0px; width: 680px;&quot;&gt;&lt;p class=&quot;jr js gl jt b hk ju jv jw hn jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km ge hi&quot; data-selectable-paragraph=&quot;&quot; id=&quot;52cd&quot; style=&quot;box-sizing: inherit; color: #292929; font-family: charter, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 21px; letter-spacing: -0.003em; line-height: 32px; margin: 2em 0px -0.46em; word-break: break-word;&quot;&gt;This is actually incredibly easy to setup. We can quickly utilize the dynamic nature of Python, to control and build queries in SQL. The best part? After set-up, you don’t need to do anything.&lt;/p&gt;&lt;p class=&quot;jr js gl jt b hk ju jv jw hn jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km ge hi&quot; data-selectable-paragraph=&quot;&quot; id=&quot;caac&quot; style=&quot;box-sizing: inherit; color: #292929; font-family: charter, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 21px; letter-spacing: -0.003em; line-height: 32px; margin: 2em 0px -0.46em; word-break: break-word;&quot;&gt;Both of these amazing tools together, allow us to reach new heights of automation and efficiency.&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/section&gt;&lt;div class=&quot;n p db kn ko kp&quot; role=&quot;separator&quot; style=&quot;background-color: white; box-sizing: inherit; color: rgba(0, 0, 0, 0.8); display: flex; font-family: medium-content-sans-serif-font, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; justify-content: center; margin-bottom: 14px; margin-top: 32px; padding-bottom: 10px; padding-top: 24px;&quot;&gt;&lt;span class=&quot;kq il ca kr ks kt&quot; style=&quot;background-color: #080808; border-radius: 50%; box-sizing: inherit; display: inline-block; height: 3px; margin-right: 20px; width: 3px;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;kq il ca kr ks kt&quot; style=&quot;background-color: #080808; border-radius: 50%; box-sizing: inherit; display: inline-block; height: 3px; margin-right: 20px; width: 3px;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;kq il ca kr ks&quot; style=&quot;background-color: #080808; border-radius: 50%; box-sizing: inherit; display: inline-block; height: 3px; width: 3px;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;section class=&quot;ge gf gg du gh&quot; style=&quot;background-color: white; box-sizing: inherit; color: rgba(0, 0, 0, 0.8); font-family: medium-content-sans-serif-font, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;div class=&quot;n p&quot; style=&quot;box-sizing: inherit; display: flex; justify-content: center;&quot;&gt;&lt;div class=&quot;au av aw ax ay gi ba v&quot; style=&quot;box-sizing: inherit; margin: 0px 64px; max-width: 680px; min-width: 0px; width: 680px;&quot;&gt;&lt;h1 class=&quot;ku kv gl bf kw kx ky jv kz la lb jy lc ld le lf lg lh li lj lk ll lm ln lo lp hi&quot; data-selectable-paragraph=&quot;&quot; id=&quot;da8f&quot; style=&quot;box-sizing: inherit; color: #292929; font-family: sohne, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 30px; font-weight: 500; letter-spacing: 0px; line-height: 36px; margin: 1.25em 0px -0.28em;&quot;&gt;pyodbc&lt;/h1&gt;&lt;p class=&quot;jr js gl jt b hk lq jv jw hn lr jy jz ka ls kc kd ke lt kg kh ki lu kk kl km ge hi&quot; data-selectable-paragraph=&quot;&quot; id=&quot;0b1e&quot; style=&quot;box-sizing: inherit; color: #292929; font-family: charter, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 21px; letter-spacing: -0.003em; line-height: 32px; margin: 0.86em 0px -0.46em; word-break: break-word;&quot;&gt;Our bridge bet&lt;span id=&quot;rmm&quot; style=&quot;box-sizing: inherit;&quot;&gt;w&lt;/span&gt;een the two technologies is&amp;nbsp;&lt;code class=&quot;lv lw lx ly lz b&quot; style=&quot;background-color: #f2f2f2; box-sizing: inherit; font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 15.75px; padding: 2px 4px;&quot;&gt;pyodbc&lt;/code&gt;. This library allows easy access to ODBC databases.&lt;/p&gt;&lt;p class=&quot;jr js gl jt b hk ju jv jw hn jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km ge hi&quot; data-selectable-paragraph=&quot;&quot; id=&quot;41c6&quot; style=&quot;box-sizing: inherit; color: #292929; font-family: charter, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 21px; letter-spacing: -0.003em; line-height: 32px; margin: 2em 0px -0.46em; word-break: break-word;&quot;&gt;ODBC, short for Open Database Connectivity, is a standardised application programming interface (API) for accessing databases, developed by the SQL Access group back in the early 90&#39;s.&lt;/p&gt;&lt;p class=&quot;jr js gl jt b hk ju jv jw hn jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km ge hi&quot; data-selectable-paragraph=&quot;&quot; id=&quot;9b32&quot; style=&quot;box-sizing: inherit; color: #292929; font-family: charter, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 21px; letter-spacing: -0.003em; line-height: 32px; margin: 2em 0px -0.46em; word-break: break-word;&quot;&gt;Compliant database management systems (DBMS) include:&lt;/p&gt;&lt;ul class=&quot;&quot; style=&quot;box-sizing: inherit; list-style: none none; margin: 0px; padding: 0px;&quot;&gt;&lt;li class=&quot;jr js gl jt b hk ju jv jw hn jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km ma mb mc hi&quot; data-selectable-paragraph=&quot;&quot; id=&quot;d4b6&quot; style=&quot;box-sizing: inherit; color: #292929; font-family: charter, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 21px; letter-spacing: -0.003em; line-height: 32px; list-style-type: disc; margin-bottom: -0.46em; margin-left: 30px; margin-top: 2em; padding-left: 0px;&quot;&gt;IBM Db2&lt;/li&gt;&lt;li class=&quot;jr js gl jt b hk md jv jw hn me jy jz ka mf kc kd ke mg kg kh ki mh kk kl km ma mb mc hi&quot; data-selectable-paragraph=&quot;&quot; id=&quot;1638&quot; style=&quot;box-sizing: inherit; color: #292929; font-family: charter, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 21px; letter-spacing: -0.003em; line-height: 32px; list-style-type: disc; margin-bottom: -0.46em; margin-left: 30px; margin-top: 1.05em; padding-left: 0px;&quot;&gt;MS Access&lt;/li&gt;&lt;li class=&quot;jr js gl jt b hk md jv jw hn me jy jz ka mf kc kd ke mg kg kh ki mh kk kl km ma mb mc hi&quot; data-selectable-paragraph=&quot;&quot; id=&quot;aaf2&quot; style=&quot;box-sizing: inherit; color: #292929; font-family: charter, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 21px; letter-spacing: -0.003em; line-height: 32px; list-style-type: disc; margin-bottom: -0.46em; margin-left: 30px; margin-top: 1.05em; padding-left: 0px;&quot;&gt;MS SQL Server&lt;/li&gt;&lt;li class=&quot;jr js gl jt b hk md jv jw hn me jy jz ka mf kc kd ke mg kg kh ki mh kk kl km ma mb mc hi&quot; data-selectable-paragraph=&quot;&quot; id=&quot;66a1&quot; style=&quot;box-sizing: inherit; color: #292929; font-family: charter, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 21px; letter-spacing: -0.003em; line-height: 32px; list-style-type: disc; margin-bottom: -0.46em; margin-left: 30px; margin-top: 1.05em; padding-left: 0px;&quot;&gt;MySQL&lt;/li&gt;&lt;li class=&quot;jr js gl jt b hk md jv jw hn me jy jz ka mf kc kd ke mg kg kh ki mh kk kl km ma mb mc hi&quot; data-selectable-paragraph=&quot;&quot; id=&quot;85c4&quot; style=&quot;box-sizing: inherit; color: #292929; font-family: charter, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 21px; letter-spacing: -0.003em; line-height: 32px; list-style-type: disc; margin-bottom: -0.46em; margin-left: 30px; margin-top: 1.05em; padding-left: 0px;&quot;&gt;Oracle&lt;/li&gt;&lt;/ul&gt;&lt;p class=&quot;jr js gl jt b hk ju jv jw hn jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km ge hi&quot; data-selectable-paragraph=&quot;&quot; id=&quot;26e7&quot; style=&quot;box-sizing: inherit; color: #292929; font-family: charter, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 21px; letter-spacing: -0.003em; line-height: 32px; margin: 2em 0px -0.46em; word-break: break-word;&quot;&gt;In this article, we will be using MS SQL Server. For the most part, this should be directly transferable for use with any ODBC compliant database. The only change required should be with the connection setup.&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/section&gt;&lt;div class=&quot;n p db kn ko kp&quot; role=&quot;separator&quot; style=&quot;background-color: white; box-sizing: inherit; color: rgba(0, 0, 0, 0.8); display: flex; font-family: medium-content-sans-serif-font, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; justify-content: center; margin-bottom: 14px; margin-top: 32px; padding-bottom: 10px; padding-top: 24px;&quot;&gt;&lt;span class=&quot;kq il ca kr ks kt&quot; style=&quot;background-color: #080808; border-radius: 50%; box-sizing: inherit; display: inline-block; height: 3px; margin-right: 20px; width: 3px;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;kq il ca kr ks kt&quot; style=&quot;background-color: #080808; border-radius: 50%; box-sizing: inherit; display: inline-block; height: 3px; margin-right: 20px; width: 3px;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;kq il ca kr ks&quot; style=&quot;background-color: #080808; border-radius: 50%; box-sizing: inherit; display: inline-block; height: 3px; width: 3px;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;section class=&quot;ge gf gg du gh&quot; style=&quot;background-color: white; box-sizing: inherit; color: rgba(0, 0, 0, 0.8); font-family: medium-content-sans-serif-font, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;div class=&quot;n p&quot; style=&quot;box-sizing: inherit; display: flex; justify-content: center;&quot;&gt;&lt;div class=&quot;au av aw ax ay gi ba v&quot; style=&quot;box-sizing: inherit; margin: 0px 64px; max-width: 680px; min-width: 0px; width: 680px;&quot;&gt;&lt;h1 class=&quot;ku kv gl bf kw kx ky jv kz la lb jy lc ld le lf lg lh li lj lk ll lm ln lo lp hi&quot; data-selectable-paragraph=&quot;&quot; id=&quot;ce6a&quot; style=&quot;box-sizing: inherit; color: #292929; font-family: sohne, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 30px; font-weight: 500; letter-spacing: 0px; line-height: 36px; margin: 1.25em 0px -0.28em;&quot;&gt;Connect&lt;/h1&gt;&lt;p class=&quot;jr js gl jt b hk lq jv jw hn lr jy jz ka ls kc kd ke lt kg kh ki lu kk kl km ge hi&quot; data-selectable-paragraph=&quot;&quot; id=&quot;eec9&quot; style=&quot;box-sizing: inherit; color: #292929; font-family: charter, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 21px; letter-spacing: -0.003em; line-height: 32px; margin: 0.86em 0px -0.46em; word-break: break-word;&quot;&gt;The first thing we need to do is create a connection to the SQL server. We can do this using&amp;nbsp;&lt;code class=&quot;lv lw lx ly lz b&quot; style=&quot;background-color: #f2f2f2; box-sizing: inherit; font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 15.75px; padding: 2px 4px;&quot;&gt;pyodbc.connect&lt;/code&gt;. Within this function we must also pass a connection string.&lt;/p&gt;&lt;p class=&quot;jr js gl jt b hk ju jv jw hn jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km ge hi&quot; data-selectable-paragraph=&quot;&quot; id=&quot;5497&quot; style=&quot;box-sizing: inherit; color: #292929; font-family: charter, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 21px; letter-spacing: -0.003em; line-height: 32px; margin: 2em 0px -0.46em; word-break: break-word;&quot;&gt;This connection string must specify the DBMS&amp;nbsp;&lt;code class=&quot;lv lw lx ly lz b&quot; style=&quot;background-color: #f2f2f2; box-sizing: inherit; font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 15.75px; padding: 2px 4px;&quot;&gt;Driver&lt;/code&gt;, the&amp;nbsp;&lt;code class=&quot;lv lw lx ly lz b&quot; style=&quot;background-color: #f2f2f2; box-sizing: inherit; font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 15.75px; padding: 2px 4px;&quot;&gt;Server&lt;/code&gt;, a specific&amp;nbsp;&lt;code class=&quot;lv lw lx ly lz b&quot; style=&quot;background-color: #f2f2f2; box-sizing: inherit; font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 15.75px; padding: 2px 4px;&quot;&gt;Database&lt;/code&gt;&amp;nbsp;to connect to, and our connection settings.&lt;/p&gt;&lt;p class=&quot;jr js gl jt b hk ju jv jw hn jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km ge hi&quot; data-selectable-paragraph=&quot;&quot; id=&quot;19b3&quot; style=&quot;box-sizing: inherit; color: #292929; font-family: charter, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 21px; letter-spacing: -0.003em; line-height: 32px; margin: 2em 0px -0.46em; word-break: break-word;&quot;&gt;So, lets assume we want to connect to server&amp;nbsp;&lt;code class=&quot;lv lw lx ly lz b&quot; style=&quot;background-color: #f2f2f2; box-sizing: inherit; font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 15.75px; padding: 2px 4px;&quot;&gt;UKXXX00123,45600&lt;/code&gt;, database&amp;nbsp;&lt;code class=&quot;lv lw lx ly lz b&quot; style=&quot;background-color: #f2f2f2; box-sizing: inherit; font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 15.75px; padding: 2px 4px;&quot;&gt;DB01&lt;/code&gt;&amp;nbsp;, to do this we want to use&amp;nbsp;&lt;code class=&quot;lv lw lx ly lz b&quot; style=&quot;background-color: #f2f2f2; box-sizing: inherit; font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 15.75px; padding: 2px 4px;&quot;&gt;SQL Server Native Client 11.0&lt;/code&gt;.&lt;/p&gt;&lt;p class=&quot;jr js gl jt b hk ju jv jw hn jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km ge hi&quot; data-selectable-paragraph=&quot;&quot; id=&quot;676f&quot; style=&quot;box-sizing: inherit; color: #292929; font-family: charter, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 21px; letter-spacing: -0.003em; line-height: 32px; margin: 2em 0px -0.46em; word-break: break-word;&quot;&gt;We will be connecting from an internal, and thus trusted connection (we do not need to enter our username and password).&lt;/p&gt;&lt;pre class=&quot;mi mj mk ml mm mn mo mp&quot; style=&quot;background: rgb(242, 242, 242); box-sizing: inherit; margin-bottom: 0px; margin-top: 56px; overflow-x: auto; padding: 20px;&quot;&gt;&lt;span class=&quot;hi mq kv gl lz b dn mr ms s mt&quot; data-selectable-paragraph=&quot;&quot; id=&quot;ddb2&quot; style=&quot;box-sizing: inherit; color: #292929; display: block; font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 16px; letter-spacing: -0.022em; line-height: 1.18; margin-bottom: -0.09em; margin-top: -0.09em; white-space: pre-wrap;&quot;&gt;cnxn_str = (&quot;Driver={SQL Server Native Client 11.0};&quot;&lt;br style=&quot;box-sizing: inherit;&quot; /&gt;            &quot;Server=UKXXX00123,45600;&quot;&lt;br style=&quot;box-sizing: inherit;&quot; /&gt;            &quot;Database=DB01;&quot;&lt;br style=&quot;box-sizing: inherit;&quot; /&gt;            &quot;Trusted_Connection=yes;&quot;)&lt;/span&gt;&lt;/pre&gt;&lt;p class=&quot;jr js gl jt b hk ju jv jw hn jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km ge hi&quot; data-selectable-paragraph=&quot;&quot; id=&quot;5e9e&quot; style=&quot;box-sizing: inherit; color: #292929; font-family: charter, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 21px; letter-spacing: -0.003em; line-height: 32px; margin: 2em 0px -0.46em; word-break: break-word;&quot;&gt;Our connection is now initialized with:&lt;/p&gt;&lt;pre class=&quot;mi mj mk ml mm mn mo mp&quot; style=&quot;background: rgb(242, 242, 242); box-sizing: inherit; margin-bottom: 0px; margin-top: 56px; overflow-x: auto; padding: 20px;&quot;&gt;&lt;span class=&quot;hi mq kv gl lz b dn mr ms s mt&quot; data-selectable-paragraph=&quot;&quot; id=&quot;fdc9&quot; style=&quot;box-sizing: inherit; color: #292929; display: block; font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 16px; letter-spacing: -0.022em; line-height: 1.18; margin-bottom: -0.09em; margin-top: -0.09em; white-space: pre-wrap;&quot;&gt;cnxn = pyodbc.connect(cnxn_str)&lt;/span&gt;&lt;/pre&gt;&lt;p class=&quot;jr js gl jt b hk ju jv jw hn jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km ge hi&quot; data-selectable-paragraph=&quot;&quot; id=&quot;83f0&quot; style=&quot;box-sizing: inherit; color: #292929; font-family: charter, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 21px; letter-spacing: -0.003em; line-height: 32px; margin: 2em 0px -0.46em; word-break: break-word;&quot;&gt;If we are not accessing the database via a trusted connection, we will need to enter the username and password that we would usually use to access the server via SQL Server Management Studio (SSMS).&lt;/p&gt;&lt;p class=&quot;jr js gl jt b hk ju jv jw hn jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km ge hi&quot; data-selectable-paragraph=&quot;&quot; id=&quot;5889&quot; style=&quot;box-sizing: inherit; color: #292929; font-family: charter, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 21px; letter-spacing: -0.003em; line-height: 32px; margin: 2em 0px -0.46em; word-break: break-word;&quot;&gt;For example, if our username is&amp;nbsp;&lt;code class=&quot;lv lw lx ly lz b&quot; style=&quot;background-color: #f2f2f2; box-sizing: inherit; font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 15.75px; padding: 2px 4px;&quot;&gt;JoeBloggs&lt;/code&gt;, and our password is&amp;nbsp;&lt;code class=&quot;lv lw lx ly lz b&quot; style=&quot;background-color: #f2f2f2; box-sizing: inherit; font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 15.75px; padding: 2px 4px;&quot;&gt;Password123&lt;/code&gt;, we should immediately change our password.&lt;/p&gt;&lt;p class=&quot;jr js gl jt b hk ju jv jw hn jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km ge hi&quot; data-selectable-paragraph=&quot;&quot; id=&quot;beeb&quot; style=&quot;box-sizing: inherit; color: #292929; font-family: charter, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 21px; letter-spacing: -0.003em; line-height: 32px; margin: 2em 0px -0.46em; word-break: break-word;&quot;&gt;But before changing that horrible password, we can connect like so:&lt;/p&gt;&lt;pre class=&quot;mi mj mk ml mm mn mo mp&quot; style=&quot;background: rgb(242, 242, 242); box-sizing: inherit; margin-bottom: 0px; margin-top: 56px; overflow-x: auto; padding: 20px;&quot;&gt;&lt;span class=&quot;hi mq kv gl lz b dn mr ms s mt&quot; data-selectable-paragraph=&quot;&quot; id=&quot;4fec&quot; style=&quot;box-sizing: inherit; color: #292929; display: block; font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 16px; letter-spacing: -0.022em; line-height: 1.18; margin-bottom: -0.09em; margin-top: -0.09em; white-space: pre-wrap;&quot;&gt;cnxn_str = (&quot;Driver={SQL Server Native Client 11.0};&quot;&lt;br style=&quot;box-sizing: inherit;&quot; /&gt;            &quot;Server=UKXXX00123,45600;&quot;&lt;br style=&quot;box-sizing: inherit;&quot; /&gt;            &quot;Database=DB01;&quot;&lt;br style=&quot;box-sizing: inherit;&quot; /&gt;            &quot;UID=JoeBloggs;&quot;&lt;br style=&quot;box-sizing: inherit;&quot; /&gt;            &quot;PWD=Password123;&quot;)&lt;/span&gt;&lt;span class=&quot;hi mq kv gl lz b dn mu mv mw mx my ms s mt&quot; data-selectable-paragraph=&quot;&quot; id=&quot;259c&quot; style=&quot;box-sizing: inherit; color: #292929; display: block; font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 16px; letter-spacing: -0.022em; line-height: 1.18; margin-bottom: -0.09em; margin-top: 1.91em; white-space: pre-wrap;&quot;&gt;cnxn = pyodbc.connect(cnxn_str)&lt;/span&gt;&lt;/pre&gt;&lt;p class=&quot;jr js gl jt b hk ju jv jw hn jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km ge hi&quot; data-selectable-paragraph=&quot;&quot; id=&quot;af81&quot; style=&quot;box-sizing: inherit; color: #292929; font-family: charter, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 21px; letter-spacing: -0.003em; line-height: 32px; margin: 2em 0px -0.46em; word-break: break-word;&quot;&gt;Now we are connected to the database, we can begin performing SQL queries via Python.&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/section&gt;&lt;div class=&quot;n p db kn ko kp&quot; role=&quot;separator&quot; style=&quot;background-color: white; box-sizing: inherit; color: rgba(0, 0, 0, 0.8); display: flex; font-family: medium-content-sans-serif-font, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; justify-content: center; margin-bottom: 14px; margin-top: 32px; padding-bottom: 10px; padding-top: 24px;&quot;&gt;&lt;span class=&quot;kq il ca kr ks kt&quot; style=&quot;background-color: #080808; border-radius: 50%; box-sizing: inherit; display: inline-block; height: 3px; margin-right: 20px; width: 3px;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;kq il ca kr ks kt&quot; style=&quot;background-color: #080808; border-radius: 50%; box-sizing: inherit; display: inline-block; height: 3px; margin-right: 20px; width: 3px;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;kq il ca kr ks&quot; style=&quot;background-color: #080808; border-radius: 50%; box-sizing: inherit; display: inline-block; height: 3px; width: 3px;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;section class=&quot;ge gf gg du gh&quot; style=&quot;background-color: white; box-sizing: inherit; color: rgba(0, 0, 0, 0.8); font-family: medium-content-sans-serif-font, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;div class=&quot;n p&quot; style=&quot;box-sizing: inherit; display: flex; justify-content: center;&quot;&gt;&lt;div class=&quot;au av aw ax ay gi ba v&quot; style=&quot;box-sizing: inherit; margin: 0px 64px; max-width: 680px; min-width: 0px; width: 680px;&quot;&gt;&lt;h1 class=&quot;ku kv gl bf kw kx ky jv kz la lb jy lc ld le lf lg lh li lj lk ll lm ln lo lp hi&quot; data-selectable-paragraph=&quot;&quot; id=&quot;7519&quot; style=&quot;box-sizing: inherit; color: #292929; font-family: sohne, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 30px; font-weight: 500; letter-spacing: 0px; line-height: 36px; margin: 1.25em 0px -0.28em;&quot;&gt;Run a Query&lt;/h1&gt;&lt;p class=&quot;jr js gl jt b hk lq jv jw hn lr jy jz ka ls kc kd ke lt kg kh ki lu kk kl km ge hi&quot; data-selectable-paragraph=&quot;&quot; id=&quot;a02c&quot; style=&quot;box-sizing: inherit; color: #292929; font-family: charter, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 21px; letter-spacing: -0.003em; line-height: 32px; margin: 0.86em 0px -0.46em; word-break: break-word;&quot;&gt;Every query we run on SQL Server now will consist of a cursor initialization, and query execution. Additionally, if we make any changes inside the server, we also need to commit these changes to the server (which we cover in the next section).&lt;/p&gt;&lt;p class=&quot;jr js gl jt b hk ju jv jw hn jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km ge hi&quot; data-selectable-paragraph=&quot;&quot; id=&quot;d672&quot; style=&quot;box-sizing: inherit; color: #292929; font-family: charter, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 21px; letter-spacing: -0.003em; line-height: 32px; margin: 2em 0px -0.46em; word-break: break-word;&quot;&gt;To initialize a cursor:&lt;/p&gt;&lt;pre class=&quot;mi mj mk ml mm mn mo mp&quot; style=&quot;background: rgb(242, 242, 242); box-sizing: inherit; margin-bottom: 0px; margin-top: 56px; overflow-x: auto; padding: 20px;&quot;&gt;&lt;span class=&quot;hi mq kv gl lz b dn mr ms s mt&quot; data-selectable-paragraph=&quot;&quot; id=&quot;17db&quot; style=&quot;box-sizing: inherit; color: #292929; display: block; font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 16px; letter-spacing: -0.022em; line-height: 1.18; margin-bottom: -0.09em; margin-top: -0.09em; white-space: pre-wrap;&quot;&gt;cursor = cnxn.cursor()&lt;/span&gt;&lt;/pre&gt;&lt;p class=&quot;jr js gl jt b hk ju jv jw hn jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km ge hi&quot; data-selectable-paragraph=&quot;&quot; id=&quot;6d50&quot; style=&quot;box-sizing: inherit; color: #292929; font-family: charter, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 21px; letter-spacing: -0.003em; line-height: 32px; margin: 2em 0px -0.46em; word-break: break-word;&quot;&gt;Now, whenever we want to perform a query, we use this&amp;nbsp;&lt;code class=&quot;lv lw lx ly lz b&quot; style=&quot;background-color: #f2f2f2; box-sizing: inherit; font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 15.75px; padding: 2px 4px;&quot;&gt;cursor&lt;/code&gt;&amp;nbsp;object.&lt;/p&gt;&lt;p class=&quot;jr js gl jt b hk ju jv jw hn jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km ge hi&quot; data-selectable-paragraph=&quot;&quot; id=&quot;e9fb&quot; style=&quot;box-sizing: inherit; color: #292929; font-family: charter, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 21px; letter-spacing: -0.003em; line-height: 32px; margin: 2em 0px -0.46em; word-break: break-word;&quot;&gt;Let’s first select the top 1000 rows from a table called&amp;nbsp;&lt;code class=&quot;lv lw lx ly lz b&quot; style=&quot;background-color: #f2f2f2; box-sizing: inherit; font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 15.75px; padding: 2px 4px;&quot;&gt;customers&lt;/code&gt;:&lt;/p&gt;&lt;pre class=&quot;mi mj mk ml mm mn mo mp&quot; style=&quot;background: rgb(242, 242, 242); box-sizing: inherit; margin-bottom: 0px; margin-top: 56px; overflow-x: auto; padding: 20px;&quot;&gt;&lt;span class=&quot;hi mq kv gl lz b dn mr ms s mt&quot; data-selectable-paragraph=&quot;&quot; id=&quot;712a&quot; style=&quot;box-sizing: inherit; color: #292929; display: block; font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 16px; letter-spacing: -0.022em; line-height: 1.18; margin-bottom: -0.09em; margin-top: -0.09em; white-space: pre-wrap;&quot;&gt;cursor.execute(&quot;SELECT TOP(1000) * FROM customers&quot;)&lt;/span&gt;&lt;/pre&gt;&lt;p class=&quot;jr js gl jt b hk ju jv jw hn jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km ge hi&quot; data-selectable-paragraph=&quot;&quot; id=&quot;3a0b&quot; style=&quot;box-sizing: inherit; color: #292929; font-family: charter, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 21px; letter-spacing: -0.003em; line-height: 32px; margin: 2em 0px -0.46em; word-break: break-word;&quot;&gt;This performs the operation, but within the server, and so nothing is actually returned to Python. So let’s look at extracting this data from SQL.&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/section&gt;&lt;div class=&quot;n p db kn ko kp&quot; role=&quot;separator&quot; style=&quot;background-color: white; box-sizing: inherit; color: rgba(0, 0, 0, 0.8); display: flex; font-family: medium-content-sans-serif-font, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; justify-content: center; margin-bottom: 14px; margin-top: 32px; padding-bottom: 10px; padding-top: 24px;&quot;&gt;&lt;span class=&quot;kq il ca kr ks kt&quot; style=&quot;background-color: #080808; border-radius: 50%; box-sizing: inherit; display: inline-block; height: 3px; margin-right: 20px; width: 3px;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;kq il ca kr ks kt&quot; style=&quot;background-color: #080808; border-radius: 50%; box-sizing: inherit; display: inline-block; height: 3px; margin-right: 20px; width: 3px;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;kq il ca kr ks&quot; style=&quot;background-color: #080808; border-radius: 50%; box-sizing: inherit; display: inline-block; height: 3px; width: 3px;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;section class=&quot;ge gf gg du gh&quot; style=&quot;background-color: white; box-sizing: inherit; color: rgba(0, 0, 0, 0.8); font-family: medium-content-sans-serif-font, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;div class=&quot;n p&quot; style=&quot;box-sizing: inherit; display: flex; justify-content: center;&quot;&gt;&lt;div class=&quot;au av aw ax ay gi ba v&quot; style=&quot;box-sizing: inherit; margin: 0px 64px; max-width: 680px; min-width: 0px; width: 680px;&quot;&gt;&lt;h1 class=&quot;ku kv gl bf kw kx ky jv kz la lb jy lc ld le lf lg lh li lj lk ll lm ln lo lp hi&quot; data-selectable-paragraph=&quot;&quot; id=&quot;66f1&quot; style=&quot;box-sizing: inherit; color: #292929; font-family: sohne, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 30px; font-weight: 500; letter-spacing: 0px; line-height: 36px; margin: 1.25em 0px -0.28em;&quot;&gt;Extract Data&lt;/h1&gt;&lt;p class=&quot;jr js gl jt b hk lq jv jw hn lr jy jz ka ls kc kd ke lt kg kh ki lu kk kl km ge hi&quot; data-selectable-paragraph=&quot;&quot; id=&quot;b4c7&quot; style=&quot;box-sizing: inherit; color: #292929; font-family: charter, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 21px; letter-spacing: -0.003em; line-height: 32px; margin: 0.86em 0px -0.46em; word-break: break-word;&quot;&gt;To extract our data from SQL into Python, we use&amp;nbsp;&lt;code class=&quot;lv lw lx ly lz b&quot; style=&quot;background-color: #f2f2f2; box-sizing: inherit; font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 15.75px; padding: 2px 4px;&quot;&gt;pandas&lt;/code&gt;. Pandas provides us with a very convenient function called&amp;nbsp;&lt;code class=&quot;lv lw lx ly lz b&quot; style=&quot;background-color: #f2f2f2; box-sizing: inherit; font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 15.75px; padding: 2px 4px;&quot;&gt;read_sql&lt;/code&gt;, this function, as you may have guessed, reads data from SQL.&lt;/p&gt;&lt;p class=&quot;jr js gl jt b hk ju jv jw hn jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km ge hi&quot; data-selectable-paragraph=&quot;&quot; id=&quot;5259&quot; style=&quot;box-sizing: inherit; color: #292929; font-family: charter, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 21px; letter-spacing: -0.003em; line-height: 32px; margin: 2em 0px -0.46em; word-break: break-word;&quot;&gt;&lt;code class=&quot;lv lw lx ly lz b&quot; style=&quot;background-color: #f2f2f2; box-sizing: inherit; font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 15.75px; padding: 2px 4px;&quot;&gt;read_sql&lt;/code&gt;&amp;nbsp;requires both a query and the connection instance&amp;nbsp;&lt;code class=&quot;lv lw lx ly lz b&quot; style=&quot;background-color: #f2f2f2; box-sizing: inherit; font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 15.75px; padding: 2px 4px;&quot;&gt;cnxn&lt;/code&gt;, like so:&lt;/p&gt;&lt;pre class=&quot;mi mj mk ml mm mn mo mp&quot; style=&quot;background: rgb(242, 242, 242); box-sizing: inherit; margin-bottom: 0px; margin-top: 56px; overflow-x: auto; padding: 20px;&quot;&gt;&lt;span class=&quot;hi mq kv gl lz b dn mr ms s mt&quot; data-selectable-paragraph=&quot;&quot; id=&quot;b544&quot; style=&quot;box-sizing: inherit; color: #292929; display: block; font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 16px; letter-spacing: -0.022em; line-height: 1.18; margin-bottom: -0.09em; margin-top: -0.09em; white-space: pre-wrap;&quot;&gt;data = pd.read_sql(&quot;SELECT TOP(1000) * FROM customers&quot;, cnxn)&lt;/span&gt;&lt;/pre&gt;&lt;p class=&quot;jr js gl jt b hk ju jv jw hn jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km ge hi&quot; data-selectable-paragraph=&quot;&quot; id=&quot;0777&quot; style=&quot;box-sizing: inherit; color: #292929; font-family: charter, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 21px; letter-spacing: -0.003em; line-height: 32px; margin: 2em 0px -0.46em; word-break: break-word;&quot;&gt;This returns a dataframe containing the top 1000 rows from the&amp;nbsp;&lt;code class=&quot;lv lw lx ly lz b&quot; style=&quot;background-color: #f2f2f2; box-sizing: inherit; font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 15.75px; padding: 2px 4px;&quot;&gt;customers&lt;/code&gt;&amp;nbsp;table.&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/section&gt;&lt;div class=&quot;n p db kn ko kp&quot; role=&quot;separator&quot; style=&quot;background-color: white; box-sizing: inherit; color: rgba(0, 0, 0, 0.8); display: flex; font-family: medium-content-sans-serif-font, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; justify-content: center; margin-bottom: 14px; margin-top: 32px; padding-bottom: 10px; padding-top: 24px;&quot;&gt;&lt;span class=&quot;kq il ca kr ks kt&quot; style=&quot;background-color: #080808; border-radius: 50%; box-sizing: inherit; display: inline-block; height: 3px; margin-right: 20px; width: 3px;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;kq il ca kr ks kt&quot; style=&quot;background-color: #080808; border-radius: 50%; box-sizing: inherit; display: inline-block; height: 3px; margin-right: 20px; width: 3px;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;kq il ca kr ks&quot; style=&quot;background-color: #080808; border-radius: 50%; box-sizing: inherit; display: inline-block; height: 3px; width: 3px;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;section class=&quot;ge gf gg du gh&quot; style=&quot;background-color: white; box-sizing: inherit; color: rgba(0, 0, 0, 0.8); font-family: medium-content-sans-serif-font, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;div class=&quot;n p&quot; style=&quot;box-sizing: inherit; display: flex; justify-content: center;&quot;&gt;&lt;div class=&quot;au av aw ax ay gi ba v&quot; style=&quot;box-sizing: inherit; margin: 0px 64px; max-width: 680px; min-width: 0px; width: 680px;&quot;&gt;&lt;h1 class=&quot;ku kv gl bf kw kx ky jv kz la lb jy lc ld le lf lg lh li lj lk ll lm ln lo lp hi&quot; data-selectable-paragraph=&quot;&quot; id=&quot;56f2&quot; style=&quot;box-sizing: inherit; color: #292929; font-family: sohne, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 30px; font-weight: 500; letter-spacing: 0px; line-height: 36px; margin: 1.25em 0px -0.28em;&quot;&gt;Changing Data in SQL&lt;/h1&gt;&lt;p class=&quot;jr js gl jt b hk lq jv jw hn lr jy jz ka ls kc kd ke lt kg kh ki lu kk kl km ge hi&quot; data-selectable-paragraph=&quot;&quot; id=&quot;76aa&quot; style=&quot;box-sizing: inherit; color: #292929; font-family: charter, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 21px; letter-spacing: -0.003em; line-height: 32px; margin: 0.86em 0px -0.46em; word-break: break-word;&quot;&gt;Now, if we wanted to change the data in SQL, we need to add another step to the original initialize connection, execute query process.&lt;/p&gt;&lt;p class=&quot;jr js gl jt b hk ju jv jw hn jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km ge hi&quot; data-selectable-paragraph=&quot;&quot; id=&quot;dde4&quot; style=&quot;box-sizing: inherit; color: #292929; font-family: charter, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 21px; letter-spacing: -0.003em; line-height: 32px; margin: 2em 0px -0.46em; word-break: break-word;&quot;&gt;When we execute queries in SQL, these changes are kept in a temporarily existing space, they are not made directly to the data.&lt;/p&gt;&lt;p class=&quot;jr js gl jt b hk ju jv jw hn jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km ge hi&quot; data-selectable-paragraph=&quot;&quot; id=&quot;3d3c&quot; style=&quot;box-sizing: inherit; color: #292929; font-family: charter, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 21px; letter-spacing: -0.003em; line-height: 32px; margin: 2em 0px -0.46em; word-break: break-word;&quot;&gt;To make these changes permanent, we must&amp;nbsp;&lt;code class=&quot;lv lw lx ly lz b&quot; style=&quot;background-color: #f2f2f2; box-sizing: inherit; font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 15.75px; padding: 2px 4px;&quot;&gt;commit&lt;/code&gt;&amp;nbsp;them. Lets concatenate the&amp;nbsp;&lt;code class=&quot;lv lw lx ly lz b&quot; style=&quot;background-color: #f2f2f2; box-sizing: inherit; font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 15.75px; padding: 2px 4px;&quot;&gt;firstName&lt;/code&gt;&amp;nbsp;and&amp;nbsp;&lt;code class=&quot;lv lw lx ly lz b&quot; style=&quot;background-color: #f2f2f2; box-sizing: inherit; font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 15.75px; padding: 2px 4px;&quot;&gt;lastName&lt;/code&gt;&amp;nbsp;columns, to create a&amp;nbsp;&lt;code class=&quot;lv lw lx ly lz b&quot; style=&quot;background-color: #f2f2f2; box-sizing: inherit; font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 15.75px; padding: 2px 4px;&quot;&gt;fullName&lt;/code&gt;&amp;nbsp;column.&lt;/p&gt;&lt;pre class=&quot;mi mj mk ml mm mn mo mp&quot; style=&quot;background: rgb(242, 242, 242); box-sizing: inherit; margin-bottom: 0px; margin-top: 56px; overflow-x: auto; padding: 20px;&quot;&gt;&lt;span class=&quot;hi mq kv gl lz b dn mr ms s mt&quot; data-selectable-paragraph=&quot;&quot; id=&quot;e4c6&quot; style=&quot;box-sizing: inherit; color: #292929; display: block; font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 16px; letter-spacing: -0.022em; line-height: 1.18; margin-bottom: -0.09em; margin-top: -0.09em; white-space: pre-wrap;&quot;&gt;cursor = cnxn.cursor()&lt;/span&gt;&lt;span class=&quot;hi mq kv gl lz b dn mu mv mw mx my ms s mt&quot; data-selectable-paragraph=&quot;&quot; id=&quot;139f&quot; style=&quot;box-sizing: inherit; color: #292929; display: block; font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 16px; letter-spacing: -0.022em; line-height: 1.18; margin-bottom: -0.09em; margin-top: 1.91em; white-space: pre-wrap;&quot;&gt;# first alter the table, adding a column&lt;br style=&quot;box-sizing: inherit;&quot; /&gt;cursor.execute(&quot;ALTER TABLE customer &quot; +&lt;br style=&quot;box-sizing: inherit;&quot; /&gt;               &quot;ADD fullName VARCHAR(20)&quot;)&lt;/span&gt;&lt;span class=&quot;hi mq kv gl lz b dn mu mv mw mx my ms s mt&quot; data-selectable-paragraph=&quot;&quot; id=&quot;709c&quot; style=&quot;box-sizing: inherit; color: #292929; display: block; font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 16px; letter-spacing: -0.022em; line-height: 1.18; margin-bottom: -0.09em; margin-top: 1.91em; white-space: pre-wrap;&quot;&gt;# now update that column to contain firstName + lastName&lt;br style=&quot;box-sizing: inherit;&quot; /&gt;cursor.execute(&quot;UPDATE customer &quot; +&lt;br style=&quot;box-sizing: inherit;&quot; /&gt;               &quot;SET fullName = firstName + &quot; &quot; + lastName&quot;)&lt;/span&gt;&lt;/pre&gt;&lt;p class=&quot;jr js gl jt b hk ju jv jw hn jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km ge hi&quot; data-selectable-paragraph=&quot;&quot; id=&quot;3f2c&quot; style=&quot;box-sizing: inherit; color: #292929; font-family: charter, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 21px; letter-spacing: -0.003em; line-height: 32px; margin: 2em 0px -0.46em; word-break: break-word;&quot;&gt;At this point,&amp;nbsp;&lt;code class=&quot;lv lw lx ly lz b&quot; style=&quot;background-color: #f2f2f2; box-sizing: inherit; font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 15.75px; padding: 2px 4px;&quot;&gt;fullName&lt;/code&gt;&amp;nbsp;does not exist in our database. We must&amp;nbsp;&lt;code class=&quot;lv lw lx ly lz b&quot; style=&quot;background-color: #f2f2f2; box-sizing: inherit; font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 15.75px; padding: 2px 4px;&quot;&gt;commit&lt;/code&gt;&amp;nbsp;these changes to make them permanent:&lt;/p&gt;&lt;pre class=&quot;mi mj mk ml mm mn mo mp&quot; style=&quot;background: rgb(242, 242, 242); box-sizing: inherit; margin-bottom: 0px; margin-top: 56px; overflow-x: auto; padding: 20px;&quot;&gt;&lt;span class=&quot;hi mq kv gl lz b dn mr ms s mt&quot; data-selectable-paragraph=&quot;&quot; id=&quot;b84f&quot; style=&quot;box-sizing: inherit; color: #292929; display: block; font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 16px; letter-spacing: -0.022em; line-height: 1.18; margin-bottom: -0.09em; margin-top: -0.09em; white-space: pre-wrap;&quot;&gt;cnxn.commit()&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/section&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlserverfreak.blogspot.com/feeds/7424288237110654362/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sqlserverfreak.blogspot.com/2021/05/sql-server-with-python-intro.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/7424288237110654362'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/7424288237110654362'/><link rel='alternate' type='text/html' href='http://sqlserverfreak.blogspot.com/2021/05/sql-server-with-python-intro.html' title='SQL Server with Python - An Intro'/><author><name>SPK</name><uri>http://www.blogger.com/profile/07569889026692963359</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4468522590561210250.post-6401400418991334104</id><published>2021-05-22T05:55:00.001-07:00</published><updated>2021-05-22T05:55:03.738-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Docker installation"/><title type='text'>Docker – Installation on Windows</title><content type='html'>&lt;p style=&quot;-webkit-font-smoothing: antialiased; background-color: white; box-sizing: inherit; color: #30373e; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen-Sans, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 0px auto 1.25em; max-width: 700px;&quot;&gt;A quick walk through of Docker installation on Windows 10.&lt;/p&gt;&lt;h2 style=&quot;-webkit-font-smoothing: antialiased; background-color: white; box-sizing: inherit; color: #23282d; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen-Sans, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 1.875rem; font-weight: 500; line-height: 1.25; margin: 1.25em auto 0.75em; max-width: 700px; text-rendering: optimizelegibility;&quot;&gt;1. Downloading the binaries&lt;/h2&gt;&lt;p style=&quot;-webkit-font-smoothing: antialiased; background-color: white; box-sizing: inherit; color: #30373e; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen-Sans, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 1.25em auto; max-width: 700px;&quot;&gt;&lt;br style=&quot;-webkit-font-smoothing: antialiased; box-sizing: inherit;&quot; /&gt;Download the binaries from the&lt;a data-id=&quot;https://www.docker.com/products/docker-desktop&quot; data-type=&quot;URL&quot; href=&quot;https://www.docker.com/products/docker-desktop&quot; rel=&quot;noreferrer noopener&quot; style=&quot;-webkit-font-smoothing: antialiased; background-color: transparent; box-sizing: inherit; color: #3857f1; text-decoration-line: none; touch-action: manipulation; transition: color 0.26s cubic-bezier(0.25, 0.8, 0.25, 1) 0s;&quot; target=&quot;_blank&quot;&gt;&amp;nbsp;official website&lt;/a&gt;.&lt;br style=&quot;-webkit-font-smoothing: antialiased; box-sizing: inherit;&quot; /&gt;&lt;/p&gt;&lt;figure class=&quot;wp-block-image size-full is-resized&quot; style=&quot;-webkit-font-smoothing: antialiased; background-color: white; box-sizing: inherit; color: #30373e; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen-Sans, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 2em 0px; max-width: 100%; padding: 0px;&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;wp-image-467&quot; data-recalc-dims=&quot;1&quot; height=&quot;379&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 699px) 100vw, 699px&quot; src=&quot;https://i1.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image.png?resize=699%2C379&amp;amp;ssl=1&quot; srcset=&quot;https://i1.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image.png?w=1920&amp;amp;ssl=1 1920w, https://i1.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image.png?resize=300%2C163&amp;amp;ssl=1 300w, https://i1.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image.png?resize=1024%2C555&amp;amp;ssl=1 1024w, https://i1.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image.png?resize=768%2C416&amp;amp;ssl=1 768w, https://i1.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image.png?resize=1536%2C832&amp;amp;ssl=1 1536w&quot; style=&quot;-webkit-font-smoothing: antialiased; border-radius: inherit; border-style: none; box-sizing: inherit; display: block; height: auto; margin: 0px auto; max-width: 100%; vertical-align: middle;&quot; width=&quot;699&quot; /&gt;&lt;/figure&gt;&lt;h2 style=&quot;-webkit-font-smoothing: antialiased; background-color: white; box-sizing: inherit; color: #23282d; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen-Sans, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 1.875rem; font-weight: 500; line-height: 1.25; margin: 1.25em auto 0.75em; max-width: 700px; text-rendering: optimizelegibility;&quot;&gt;2. Install WSL 2&lt;/h2&gt;&lt;p style=&quot;-webkit-font-smoothing: antialiased; background-color: white; box-sizing: inherit; color: #30373e; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen-Sans, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 1.25em auto; max-width: 700px;&quot;&gt;Install WSL 2 following instructions provided in the&amp;nbsp;&lt;a data-id=&quot;https://docs.microsoft.com/en-us/windows/wsl/install-win10&quot; data-type=&quot;URL&quot; href=&quot;https://docs.microsoft.com/en-us/windows/wsl/install-win10&quot; rel=&quot;noreferrer noopener&quot; style=&quot;-webkit-font-smoothing: antialiased; background-color: transparent; box-sizing: inherit; color: #3857f1; text-decoration-line: none; touch-action: manipulation; transition: color 0.26s cubic-bezier(0.25, 0.8, 0.25, 1) 0s;&quot; target=&quot;_blank&quot;&gt;Microsoft website&lt;/a&gt;. This step can be done before installing the docker or alternatively we can let docker installer install it for us&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: inherit; font-weight: 600;&quot;&gt;. Windows Sub System for Linux&lt;/span&gt;&amp;nbsp;provides environment to run GNU/Linux environment , command line tools , utilities directly on Windows without installing a VM or dual boot .&lt;/p&gt;&lt;h2 style=&quot;-webkit-font-smoothing: antialiased; background-color: white; box-sizing: inherit; color: #23282d; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen-Sans, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 1.875rem; font-weight: 500; line-height: 1.25; margin: 1.25em auto 0.75em; max-width: 700px; text-rendering: optimizelegibility;&quot;&gt;3. Installing Docker&lt;/h2&gt;&lt;p style=&quot;-webkit-font-smoothing: antialiased; background-color: white; box-sizing: inherit; color: #30373e; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen-Sans, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 1.25em auto; max-width: 700px;&quot;&gt;Go to the place where we have downloaded the&amp;nbsp;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: inherit; font-weight: 600;&quot;&gt;Docker Desktop Installer.exe&lt;/span&gt;&amp;nbsp;, right click Run as administrator.&lt;br style=&quot;-webkit-font-smoothing: antialiased; box-sizing: inherit;&quot; /&gt;Unlike other installers , Docker installer will not prompt us with many options . The only two options that we will see during installation are&amp;nbsp;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: inherit; font-weight: 600;&quot;&gt;“Install required Windows components for WSL 2 “&lt;/span&gt;&amp;nbsp;and&amp;nbsp;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: inherit; font-weight: 600;&quot;&gt;“Add shortcut to desktop”&lt;/span&gt;. Select both the options and click&amp;nbsp;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: inherit; font-weight: 600;&quot;&gt;ok&lt;/span&gt;&amp;nbsp;to start the installation.&lt;/p&gt;&lt;figure class=&quot;wp-block-image size-large&quot; style=&quot;-webkit-font-smoothing: antialiased; background-color: white; box-sizing: inherit; color: #30373e; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen-Sans, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 2em 0px; max-width: 100%; padding: 0px;&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;wp-image-469&quot; data-recalc-dims=&quot;1&quot; height=&quot;489&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 706px) 100vw, 706px&quot; src=&quot;https://i0.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-2.png?resize=706%2C489&amp;amp;ssl=1&quot; srcset=&quot;https://i0.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-2.png?w=706&amp;amp;ssl=1 706w, https://i0.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-2.png?resize=300%2C208&amp;amp;ssl=1 300w&quot; style=&quot;-webkit-font-smoothing: antialiased; border-radius: inherit; border-style: none; box-sizing: inherit; display: block; height: auto; margin: 0px auto; max-width: 100%; vertical-align: middle;&quot; width=&quot;706&quot; /&gt;&lt;/figure&gt;&lt;p style=&quot;-webkit-font-smoothing: antialiased; background-color: white; box-sizing: inherit; color: #30373e; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen-Sans, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 1.25em auto; max-width: 700px;&quot;&gt;Wait for the installation to go through.&lt;/p&gt;&lt;figure class=&quot;wp-block-image size-large&quot; style=&quot;-webkit-font-smoothing: antialiased; background-color: white; box-sizing: inherit; color: #30373e; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen-Sans, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 2em 0px; max-width: 100%; padding: 0px;&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;wp-image-470&quot; data-recalc-dims=&quot;1&quot; height=&quot;489&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 706px) 100vw, 706px&quot; src=&quot;https://i2.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-3.png?resize=706%2C489&amp;amp;ssl=1&quot; srcset=&quot;https://i2.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-3.png?w=706&amp;amp;ssl=1 706w, https://i2.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-3.png?resize=300%2C208&amp;amp;ssl=1 300w&quot; style=&quot;-webkit-font-smoothing: antialiased; border-radius: inherit; border-style: none; box-sizing: inherit; display: block; height: auto; margin: 0px auto; max-width: 100%; vertical-align: middle;&quot; width=&quot;706&quot; /&gt;&lt;/figure&gt;&lt;p style=&quot;-webkit-font-smoothing: antialiased; background-color: white; box-sizing: inherit; color: #30373e; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen-Sans, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 1.25em auto; max-width: 700px;&quot;&gt;Once the installation is successful , we will see the following screen :&lt;/p&gt;&lt;figure class=&quot;wp-block-image size-large&quot; style=&quot;-webkit-font-smoothing: antialiased; background-color: white; box-sizing: inherit; color: #30373e; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen-Sans, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 2em 0px; max-width: 100%; padding: 0px;&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;wp-image-471&quot; data-recalc-dims=&quot;1&quot; height=&quot;489&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 706px) 100vw, 706px&quot; src=&quot;https://i1.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-4.png?resize=706%2C489&amp;amp;ssl=1&quot; srcset=&quot;https://i1.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-4.png?w=706&amp;amp;ssl=1 706w, https://i1.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-4.png?resize=300%2C208&amp;amp;ssl=1 300w&quot; style=&quot;-webkit-font-smoothing: antialiased; border-radius: inherit; border-style: none; box-sizing: inherit; display: block; height: auto; margin: 0px auto; max-width: 100%; vertical-align: middle;&quot; width=&quot;706&quot; /&gt;&lt;/figure&gt;&lt;h2 style=&quot;-webkit-font-smoothing: antialiased; background-color: white; box-sizing: inherit; color: #23282d; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen-Sans, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 1.875rem; font-weight: 500; line-height: 1.25; margin: 1.25em auto 0.75em; max-width: 700px; text-rendering: optimizelegibility;&quot;&gt;4. Starting Docker Desktop&lt;/h2&gt;&lt;p style=&quot;-webkit-font-smoothing: antialiased; background-color: white; box-sizing: inherit; color: #30373e; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen-Sans, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 1.25em auto; max-width: 700px;&quot;&gt;Before we can execute any Docker command, we have to first start the Docker desktop. We can start the Docker Desktop from the start menu or from the desktop icon.&lt;/p&gt;&lt;figure class=&quot;wp-block-image size-large&quot; style=&quot;-webkit-font-smoothing: antialiased; background-color: white; box-sizing: inherit; color: #30373e; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen-Sans, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 2em 0px; max-width: 100%; padding: 0px;&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;wp-image-473&quot; data-recalc-dims=&quot;1&quot; height=&quot;935&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 784px) 100vw, 784px&quot; src=&quot;https://i0.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-6.png?resize=784%2C935&amp;amp;ssl=1&quot; srcset=&quot;https://i0.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-6.png?w=784&amp;amp;ssl=1 784w, https://i0.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-6.png?resize=252%2C300&amp;amp;ssl=1 252w, https://i0.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-6.png?resize=768%2C916&amp;amp;ssl=1 768w&quot; style=&quot;-webkit-font-smoothing: antialiased; border-radius: inherit; border-style: none; box-sizing: inherit; display: block; height: auto; margin: 0px auto; max-width: 100%; vertical-align: middle;&quot; width=&quot;784&quot; /&gt;&lt;/figure&gt;&lt;figure class=&quot;wp-block-image size-large&quot; style=&quot;-webkit-font-smoothing: antialiased; background-color: white; box-sizing: inherit; color: #30373e; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen-Sans, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 2em 0px; max-width: 100%; padding: 0px;&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;wp-image-475&quot; data-recalc-dims=&quot;1&quot; height=&quot;590&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 1024px) 100vw, 1024px&quot; src=&quot;https://i1.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-8.png?resize=1024%2C590&amp;amp;ssl=1&quot; srcset=&quot;https://i1.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-8.png?resize=1024%2C590&amp;amp;ssl=1 1024w, https://i1.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-8.png?resize=300%2C173&amp;amp;ssl=1 300w, https://i1.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-8.png?resize=768%2C442&amp;amp;ssl=1 768w, https://i1.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-8.png?w=1250&amp;amp;ssl=1 1250w&quot; style=&quot;-webkit-font-smoothing: antialiased; border-radius: inherit; border-style: none; box-sizing: inherit; display: block; height: auto; margin: 0px auto; max-width: 100%; vertical-align: middle;&quot; width=&quot;1024&quot; /&gt;&lt;/figure&gt;&lt;p style=&quot;-webkit-font-smoothing: antialiased; background-color: white; box-sizing: inherit; color: #30373e; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen-Sans, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 1.25em auto; max-width: 700px;&quot;&gt;The status of the Docker engine is shown at the bottom left corner, it should be green before we can interact with Docker cli .&lt;/p&gt;&lt;figure class=&quot;wp-block-image size-large&quot; style=&quot;-webkit-font-smoothing: antialiased; background-color: white; box-sizing: inherit; color: #30373e; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen-Sans, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 2em 0px; max-width: 100%; padding: 0px;&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;wp-image-474&quot; data-recalc-dims=&quot;1&quot; height=&quot;590&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 1024px) 100vw, 1024px&quot; src=&quot;https://i2.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-7.png?resize=1024%2C590&amp;amp;ssl=1&quot; srcset=&quot;https://i2.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-7.png?resize=1024%2C590&amp;amp;ssl=1 1024w, https://i2.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-7.png?resize=300%2C173&amp;amp;ssl=1 300w, https://i2.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-7.png?resize=768%2C442&amp;amp;ssl=1 768w, https://i2.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-7.png?w=1250&amp;amp;ssl=1 1250w&quot; style=&quot;-webkit-font-smoothing: antialiased; border-radius: inherit; border-style: none; box-sizing: inherit; display: block; height: auto; margin: 0px auto; max-width: 100%; vertical-align: middle;&quot; width=&quot;1024&quot; /&gt;&lt;/figure&gt;&lt;figure class=&quot;wp-block-image size-large&quot; style=&quot;-webkit-font-smoothing: antialiased; background-color: white; box-sizing: inherit; color: #30373e; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen-Sans, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 2em 0px; max-width: 100%; padding: 0px;&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;wp-image-476&quot; data-recalc-dims=&quot;1&quot; height=&quot;590&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 1024px) 100vw, 1024px&quot; src=&quot;https://i0.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-9.png?resize=1024%2C590&amp;amp;ssl=1&quot; srcset=&quot;https://i0.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-9.png?resize=1024%2C590&amp;amp;ssl=1 1024w, https://i0.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-9.png?resize=300%2C173&amp;amp;ssl=1 300w, https://i0.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-9.png?resize=768%2C442&amp;amp;ssl=1 768w, https://i0.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-9.png?w=1250&amp;amp;ssl=1 1250w&quot; style=&quot;-webkit-font-smoothing: antialiased; border-radius: inherit; border-style: none; box-sizing: inherit; display: block; height: auto; margin: 0px auto; max-width: 100%; vertical-align: middle;&quot; width=&quot;1024&quot; /&gt;&lt;/figure&gt;&lt;h2 style=&quot;-webkit-font-smoothing: antialiased; background-color: white; box-sizing: inherit; color: #23282d; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen-Sans, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 1.875rem; font-weight: 500; line-height: 1.25; margin: 1.25em auto 0.75em; max-width: 700px; text-rendering: optimizelegibility;&quot;&gt;5. Optional Configuration&lt;/h2&gt;&lt;p style=&quot;-webkit-font-smoothing: antialiased; background-color: white; box-sizing: inherit; color: #30373e; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen-Sans, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 1.25em auto; max-width: 700px;&quot;&gt;&lt;br style=&quot;-webkit-font-smoothing: antialiased; box-sizing: inherit;&quot; /&gt;There are some configurations in Docker , which are good to have right from the start . Click on the gear icon on the top right side of the Docker Desktop dashboard .&lt;br style=&quot;-webkit-font-smoothing: antialiased; box-sizing: inherit;&quot; /&gt;&lt;/p&gt;&lt;figure class=&quot;wp-block-image size-large&quot; style=&quot;-webkit-font-smoothing: antialiased; background-color: white; box-sizing: inherit; color: #30373e; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen-Sans, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 2em 0px; max-width: 100%; padding: 0px;&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;wp-image-477&quot; data-recalc-dims=&quot;1&quot; height=&quot;590&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 1024px) 100vw, 1024px&quot; src=&quot;https://i0.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-10.png?resize=1024%2C590&amp;amp;ssl=1&quot; srcset=&quot;https://i0.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-10.png?resize=1024%2C590&amp;amp;ssl=1 1024w, https://i0.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-10.png?resize=300%2C173&amp;amp;ssl=1 300w, https://i0.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-10.png?resize=768%2C442&amp;amp;ssl=1 768w, https://i0.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-10.png?w=1250&amp;amp;ssl=1 1250w&quot; style=&quot;-webkit-font-smoothing: antialiased; border-radius: inherit; border-style: none; box-sizing: inherit; display: block; height: auto; margin: 0px auto; max-width: 100%; vertical-align: middle;&quot; width=&quot;1024&quot; /&gt;&lt;/figure&gt;&lt;h3 style=&quot;-webkit-font-smoothing: antialiased; background-color: white; box-sizing: inherit; color: #23282d; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen-Sans, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 1.625rem; font-weight: 500; line-height: 1.25; margin: 1.25em auto 0.75em; max-width: 700px; text-rendering: optimizelegibility;&quot;&gt;Enabling Kubernetes (Optional)&lt;/h3&gt;&lt;p style=&quot;-webkit-font-smoothing: antialiased; background-color: white; box-sizing: inherit; color: #30373e; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen-Sans, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 1.25em auto; max-width: 700px;&quot;&gt;Navigate to Kubernetes tab and then click on the Enable Kubernetes check box and then click on “Apply &amp;amp; Restart”. This is the fastest way to bring up k8s on our machine.&lt;br style=&quot;-webkit-font-smoothing: antialiased; box-sizing: inherit;&quot; /&gt;&lt;/p&gt;&lt;figure class=&quot;wp-block-image size-large&quot; style=&quot;-webkit-font-smoothing: antialiased; background-color: white; box-sizing: inherit; color: #30373e; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen-Sans, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 2em 0px; max-width: 100%; padding: 0px;&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;wp-image-478&quot; data-recalc-dims=&quot;1&quot; height=&quot;590&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 1024px) 100vw, 1024px&quot; src=&quot;https://i1.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-11.png?resize=1024%2C590&amp;amp;ssl=1&quot; srcset=&quot;https://i1.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-11.png?resize=1024%2C590&amp;amp;ssl=1 1024w, https://i1.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-11.png?resize=300%2C173&amp;amp;ssl=1 300w, https://i1.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-11.png?resize=768%2C442&amp;amp;ssl=1 768w, https://i1.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-11.png?w=1250&amp;amp;ssl=1 1250w&quot; style=&quot;-webkit-font-smoothing: antialiased; border-radius: inherit; border-style: none; box-sizing: inherit; display: block; height: auto; margin: 0px auto; max-width: 100%; vertical-align: middle;&quot; width=&quot;1024&quot; /&gt;&lt;/figure&gt;&lt;figure class=&quot;wp-block-image size-large&quot; style=&quot;-webkit-font-smoothing: antialiased; background-color: white; box-sizing: inherit; color: #30373e; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen-Sans, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 2em 0px; max-width: 100%; padding: 0px;&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;wp-image-481&quot; data-recalc-dims=&quot;1&quot; height=&quot;590&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 1024px) 100vw, 1024px&quot; src=&quot;https://i1.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-14.png?resize=1024%2C590&amp;amp;ssl=1&quot; srcset=&quot;https://i1.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-14.png?resize=1024%2C590&amp;amp;ssl=1 1024w, https://i1.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-14.png?resize=300%2C173&amp;amp;ssl=1 300w, https://i1.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-14.png?resize=768%2C442&amp;amp;ssl=1 768w, https://i1.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-14.png?w=1250&amp;amp;ssl=1 1250w&quot; style=&quot;-webkit-font-smoothing: antialiased; border-radius: inherit; border-style: none; box-sizing: inherit; display: block; height: auto; margin: 0px auto; max-width: 100%; vertical-align: middle;&quot; width=&quot;1024&quot; /&gt;&lt;/figure&gt;&lt;h3 style=&quot;-webkit-font-smoothing: antialiased; background-color: white; box-sizing: inherit; color: #23282d; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen-Sans, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 1.625rem; font-weight: 500; line-height: 1.25; margin: 1.25em auto 0.75em; max-width: 700px; text-rendering: optimizelegibility;&quot;&gt;Enabling WSL 2 Integration&lt;/h3&gt;&lt;p style=&quot;-webkit-font-smoothing: antialiased; background-color: white; box-sizing: inherit; color: #30373e; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen-Sans, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 1.25em auto; max-width: 700px;&quot;&gt;If we have installed any other operating system using WSL2, we don’t have to install Docker once again. We can use the same installation here also by enabling the integration.&lt;br style=&quot;-webkit-font-smoothing: antialiased; box-sizing: inherit;&quot; /&gt;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: inherit; font-weight: 600;&quot;&gt;Go to settings &amp;gt; Resources &amp;gt; WSL Integration &amp;gt; Enable the integration for the installed OS .&lt;/span&gt;&lt;/p&gt;&lt;figure class=&quot;wp-block-image size-large&quot; style=&quot;-webkit-font-smoothing: antialiased; background-color: white; box-sizing: inherit; color: #30373e; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen-Sans, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 2em 0px; max-width: 100%; padding: 0px;&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;wp-image-480&quot; data-recalc-dims=&quot;1&quot; height=&quot;590&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 1024px) 100vw, 1024px&quot; src=&quot;https://i1.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-13.png?resize=1024%2C590&amp;amp;ssl=1&quot; srcset=&quot;https://i1.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-13.png?resize=1024%2C590&amp;amp;ssl=1 1024w, https://i1.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-13.png?resize=300%2C173&amp;amp;ssl=1 300w, https://i1.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-13.png?resize=768%2C442&amp;amp;ssl=1 768w, https://i1.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-13.png?w=1250&amp;amp;ssl=1 1250w&quot; style=&quot;-webkit-font-smoothing: antialiased; border-radius: inherit; border-style: none; box-sizing: inherit; display: block; height: auto; margin: 0px auto; max-width: 100%; vertical-align: middle;&quot; width=&quot;1024&quot; /&gt;&lt;/figure&gt;&lt;h2 style=&quot;-webkit-font-smoothing: antialiased; background-color: white; box-sizing: inherit; color: #23282d; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen-Sans, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 1.875rem; font-weight: 500; line-height: 1.25; margin: 1.25em auto 0.75em; max-width: 700px; text-rendering: optimizelegibility;&quot;&gt;6. Verification&lt;/h2&gt;&lt;p style=&quot;-webkit-font-smoothing: antialiased; background-color: white; box-sizing: inherit; color: #30373e; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen-Sans, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 1.25em auto; max-width: 700px;&quot;&gt;Now that installation is complete, we verify the installation using the following command :&lt;br style=&quot;-webkit-font-smoothing: antialiased; box-sizing: inherit;&quot; /&gt;&lt;code style=&quot;-webkit-font-smoothing: antialiased; background-color: rgba(56, 87, 241, 0.09); border-radius: 3px; box-sizing: inherit; color: #3857f1; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 14.4px; overflow-wrap: break-word; padding: 0.1rem 0.3rem;&quot;&gt;docker info&lt;/code&gt;&lt;br style=&quot;-webkit-font-smoothing: antialiased; box-sizing: inherit;&quot; /&gt;This will display the details of of Docker Desktop .&lt;/p&gt;&lt;figure class=&quot;wp-block-image size-large&quot; style=&quot;-webkit-font-smoothing: antialiased; background-color: white; box-sizing: inherit; color: #30373e; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen-Sans, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 2em 0px; max-width: 100%; padding: 0px;&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;wp-image-483&quot; data-recalc-dims=&quot;1&quot; height=&quot;555&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 1024px) 100vw, 1024px&quot; src=&quot;https://i2.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-16.png?resize=1024%2C555&amp;amp;ssl=1&quot; srcset=&quot;https://i2.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-16.png?resize=1024%2C555&amp;amp;ssl=1 1024w, https://i2.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-16.png?resize=300%2C163&amp;amp;ssl=1 300w, https://i2.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-16.png?resize=768%2C416&amp;amp;ssl=1 768w, https://i2.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-16.png?resize=1536%2C832&amp;amp;ssl=1 1536w, https://i2.wp.com/srnyapathi.in/wp-content/uploads/2021/05/image-16.png?w=1920&amp;amp;ssl=1 1920w&quot; style=&quot;-webkit-font-smoothing: antialiased; border-radius: inherit; border-style: none; box-sizing: inherit; display: block; height: auto; margin: 0px auto; max-width: 100%; vertical-align: middle;&quot; width=&quot;1024&quot; /&gt;&lt;/figure&gt;&lt;p style=&quot;-webkit-font-smoothing: antialiased; background-color: white; box-sizing: inherit; color: #30373e; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen-Sans, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 1.25em auto; max-width: 700px;&quot;&gt;&lt;br style=&quot;-webkit-font-smoothing: antialiased; box-sizing: inherit;&quot; /&gt;For more on this , visit&amp;nbsp;&lt;a data-id=&quot;https://docs.docker.com/&quot; data-type=&quot;URL&quot; href=&quot;https://docs.docker.com/&quot; style=&quot;-webkit-font-smoothing: antialiased; background-color: transparent; box-sizing: inherit; color: #3857f1; text-decoration-line: none; touch-action: manipulation; transition: color 0.26s cubic-bezier(0.25, 0.8, 0.25, 1) 0s;&quot;&gt;official documentation&lt;/a&gt;&amp;nbsp;.&lt;/p&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;sharedaddy sd-sharing-enabled&quot; style=&quot;-webkit-font-smoothing: antialiased; background-color: white; box-sizing: inherit; clear: both; color: #30373e; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen-Sans, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 1.25rem auto; max-width: 700px;&quot;&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlserverfreak.blogspot.com/feeds/6401400418991334104/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sqlserverfreak.blogspot.com/2021/05/docker-installation-on-windows.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/6401400418991334104'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/6401400418991334104'/><link rel='alternate' type='text/html' href='http://sqlserverfreak.blogspot.com/2021/05/docker-installation-on-windows.html' title='Docker – Installation on Windows'/><author><name>SPK</name><uri>http://www.blogger.com/profile/07569889026692963359</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4468522590561210250.post-2364943298427314311</id><published>2021-03-22T04:29:00.003-07:00</published><updated>2021-03-22T04:29:38.087-07:00</updated><title type='text'>Using Group Managed Service Accounts with IIS 10 on Server 2016</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;span style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px;&quot;&gt;Using NetworkService powered application pools does have the nice effect, that there is no password needed, because the pool will be running with the credential of the webserver machine account, which is a domain account, where no password management is needed.&lt;/span&gt;&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;To access resources on the network, the webserver machine account must be enabled on the network destination and everything is fine and secure using windows authentication or Kerberos&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;This approach is good enough, if the scenario is limited to one application per server, because the minute you need another application, which does have different requirements in terms of security, then this approach will fail.&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;Lets assume, there are 2 web apps on the machine, which each does have its own SQL Server DB and which should not be allowed to access the other ones data.&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;&lt;a href=&quot;https://hansstan.files.wordpress.com/2017/07/image2.png&quot; style=&quot;color: #2970a6; margin: 0px; padding: 0px; text-decoration-line: none;&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;236&quot; scale=&quot;1.5&quot; src=&quot;https://hansstan.files.wordpress.com/2017/07/image_thumb2.png?w=244&amp;amp;h=236&quot; srcset=&quot;https://hansstan.files.wordpress.com/2017/07/image_thumb2.png?w=244&amp;amp;h=236&amp;amp;zoom=2 1.5x&quot; style=&quot;background-image: none; border: 0px; display: inline; margin: 0px; max-width: 600px; padding: 0px;&quot; title=&quot;image&quot; width=&quot;244&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;This scenario can only be used with custom domain accounts, if windows authentication should be used.&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;Only with 2 different accounts and 2 application pools, the security on each database can be limited to the one matching application pool.&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;But then someone has to manage this domain passwords and make sure, that they are not expiring, but still changed from time to time. A tedious task and the passwords are probably distributed across the company, hopefully in a secure way and not inside XLS or Textfiles…&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;Another way with Server 2016 is to use Group Managed Service accounts.&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;This requires, that Active Directory scheme is on level 2012 R2, only then, the feature “Group Managed Service Accounts” can be used.&lt;/p&gt;&lt;h2 style=&quot;background-color: white; border-bottom: 1px solid rgb(204, 204, 204); clear: both; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;; font-size: 16px; letter-spacing: -0.05em; margin: 10px 0px 0px; padding: 0px 5px 3px;&quot;&gt;Setup a Group Managed Service Account&lt;/h2&gt;&lt;h3 style=&quot;background-color: white; color: #555555; font-family: Arial; font-size: 18px; letter-spacing: -0.05em; margin: 0px; padding: 0px;&quot;&gt;&lt;/h3&gt;&lt;h3 style=&quot;background-color: white; color: #555555; font-family: Arial; font-size: 18px; letter-spacing: -0.05em; margin: 0px; padding: 0px;&quot;&gt;&lt;/h3&gt;&lt;h3 style=&quot;background-color: white; color: #555555; font-family: Arial; font-size: 18px; letter-spacing: -0.05em; margin: 0px; padding: 0px;&quot;&gt;Login to DC:&lt;/h3&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;Enable gMSA globally on Domain&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;— for Lab environments we use the switch –EffectiveTime, so that we don’t have to wait for 10 hours, which usually should make sure, that AD sync is ready.&lt;/p&gt;&lt;p class=&quot;inline-ad-slot&quot; data-adtags-visited=&quot;true&quot; data-adtags-width=&quot;575&quot; data-style-before-video=&quot;float:left;height:0px;margin:0 auto;overflow:hidden;width:575px;&quot; id=&quot;inline-ad-0&quot; style=&quot;background-color: white; color: #555555; float: left; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; height: 0px; margin: 0px auto; overflow: hidden; padding: 0px; width: 575px;&quot;&gt;&lt;/p&gt;&lt;div id=&quot;inline-ad-0-video&quot; style=&quot;height: auto; margin: 0px; overflow: hidden; padding: 0px; position: relative; width: 575px;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;ata-controls&quot; id=&quot;inline-ad-0__controls&quot; style=&quot;height: 10px; line-height: 10px; margin: 0px; padding: 0px; text-align: right; width: 575px;&quot;&gt;&lt;span class=&quot;ata-controls__complain-btn&quot; id=&quot;inline-ad-0__complain-btn&quot; style=&quot;color: #c8c7cc; cursor: pointer; float: right; font-family: Verdana, sans-serif; font-size: 6px; letter-spacing: 0.3px; margin: 0px; padding: 0px; text-transform: uppercase; vertical-align: middle;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;Add-KdsRootKey –EffectiveTime ((get-date).addhours(-10));&lt;/strong&gt;&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;&lt;em style=&quot;margin: 0px; padding: 0px;&quot;&gt;This will usually be done from the Active Directory team in your environment&lt;/em&gt;&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;Open ServerManager =&amp;gt; Tools =&amp;gt; Active Directory Administrative Center&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;Add new global SecurityGroup named gMSAGroup&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;&amp;nbsp;&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;&lt;a href=&quot;https://hansstan.files.wordpress.com/2017/07/clip_image0021.jpg&quot; style=&quot;color: #2970a6; margin: 0px; padding: 0px; text-decoration-line: none;&quot;&gt;&lt;img alt=&quot;clip_image002&quot; border=&quot;0&quot; height=&quot;168&quot; scale=&quot;1.5&quot; src=&quot;https://hansstan.files.wordpress.com/2017/07/clip_image002_thumb1.jpg?w=564&amp;amp;h=168&quot; srcset=&quot;https://hansstan.files.wordpress.com/2017/07/clip_image002_thumb1.jpg?w=564&amp;amp;h=168&amp;amp;zoom=2 1.5x&quot; style=&quot;background-image: none; border: 0px; display: inline; margin: 0px; max-width: 600px; padding: 0px;&quot; title=&quot;clip_image002&quot; width=&quot;564&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;&lt;a href=&quot;https://hansstan.files.wordpress.com/2017/07/clip_image0041.jpg&quot; style=&quot;color: #2970a6; margin: 0px; padding: 0px; text-decoration-line: none;&quot;&gt;&lt;img alt=&quot;clip_image004&quot; border=&quot;0&quot; height=&quot;247&quot; scale=&quot;1.5&quot; src=&quot;https://hansstan.files.wordpress.com/2017/07/clip_image004_thumb1.jpg?w=566&amp;amp;h=247&quot; srcset=&quot;https://hansstan.files.wordpress.com/2017/07/clip_image004_thumb1.jpg?w=566&amp;amp;h=247&amp;amp;zoom=2 1.5x&quot; style=&quot;background-image: none; border: 0px; display: inline; margin: 0px; max-width: 600px; padding: 0px;&quot; title=&quot;clip_image004&quot; width=&quot;566&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;Go to AD Admin Center and search for the newly created group (gMSAGroup)&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;&lt;a href=&quot;https://hansstan.files.wordpress.com/2017/07/clip_image0051.png&quot; style=&quot;color: #2970a6; margin: 0px; padding: 0px; text-decoration-line: none;&quot;&gt;&lt;img alt=&quot;clip_image005&quot; border=&quot;0&quot; height=&quot;370&quot; scale=&quot;1.5&quot; src=&quot;https://hansstan.files.wordpress.com/2017/07/clip_image005_thumb1.png?w=503&amp;amp;h=370&quot; srcset=&quot;https://hansstan.files.wordpress.com/2017/07/clip_image005_thumb1.png?w=503&amp;amp;h=370&amp;amp;zoom=2 1.5x&quot; style=&quot;background-image: none; border: 0px; display: inline; margin: 0px; max-width: 600px; padding: 0px;&quot; title=&quot;clip_image005&quot; width=&quot;503&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class=&quot;inline-ad-slot&quot; data-adtags-visited=&quot;true&quot; data-adtags-width=&quot;575&quot; id=&quot;inline-ad-1&quot; style=&quot;background-color: white; color: #555555; float: left; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; height: 0px; margin: 0px auto; overflow: hidden; padding: 0px; width: 575px;&quot;&gt;&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;OR: Use Powershell and first install the Powershell AD-modules&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;font-size:11pt; margin: 0px; padding: 0px;&quot;&gt;&lt;span style=&quot;color: black; margin: 0px; padding: 0px;&quot;&gt;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;Install-WindowsFeature -Name RSAT-AD-PowerShell&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;Then create the global security group using&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;font-size:11pt; margin: 0px; padding: 0px;&quot;&gt;&lt;span style=&quot;color: black; margin: 0px; padding: 0px;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;background-color: white; color: black; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px; padding: 0px;&quot;&gt;&lt;p style=&quot;margin: 0px 0px 10px; padding: 0px;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;font-size:11pt; margin: 0px; padding: 0px;&quot;&gt;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;NEW-ADGroup –name “gMSAGroup”&amp;nbsp; –path “OU=XYZ,DC=mydomain,DC=com” -GroupCategory Security -groupscope Global&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 0px 0px 10px; padding: 0px;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman; font-size: small; margin: 0px; padding: 0px;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;/p&gt;&lt;p style=&quot;margin: 0px 0px 10px; padding: 0px;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman; font-size: small; margin: 0px; padding: 0px;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 0px 0px 10px; padding: 0px;&quot;&gt;&lt;/p&gt;&lt;/span&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;&lt;span style=&quot;color: black; margin: 0px; padding: 0px;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;&lt;span style=&quot;color: black; font-family: Times New Roman; font-size: small; margin: 0px; padding: 0px;&quot;&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;Right click the gMSAGroup entry and add all the memberserver, which should be able to use the Group Service Managed Account IIS1Svc&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;or use Powershell:&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;Add-ADGroupMember &quot;&lt;span style=&quot;color: black; font-family: Calibri; font-size: small; margin: 0px; padding: 0px;&quot;&gt;gMSAGroup&lt;/span&gt;” -Members &quot;Server1$&quot;, &quot;Server2$&quot;&amp;nbsp;&lt;/strong&gt;&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;&lt;a href=&quot;https://hansstan.files.wordpress.com/2017/07/clip_image0071.png&quot; style=&quot;color: #2970a6; margin: 0px; padding: 0px; text-decoration-line: none;&quot;&gt;&lt;img alt=&quot;clip_image007&quot; border=&quot;0&quot; height=&quot;478&quot; scale=&quot;1.5&quot; src=&quot;https://hansstan.files.wordpress.com/2017/07/clip_image007_thumb1.png?w=543&amp;amp;h=478&quot; srcset=&quot;https://hansstan.files.wordpress.com/2017/07/clip_image007_thumb1.png?w=543&amp;amp;h=478&amp;amp;zoom=2 1.5x&quot; style=&quot;background-image: none; border: 0px; display: inline; margin: 0px; max-width: 600px; padding: 0px;&quot; title=&quot;clip_image007&quot; width=&quot;543&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;&lt;a href=&quot;https://hansstan.files.wordpress.com/2017/07/clip_image0081.png&quot; style=&quot;color: #2970a6; margin: 0px; padding: 0px; text-decoration-line: none;&quot;&gt;&lt;img alt=&quot;clip_image008&quot; border=&quot;0&quot; height=&quot;304&quot; scale=&quot;1.5&quot; src=&quot;https://hansstan.files.wordpress.com/2017/07/clip_image008_thumb1.png?w=533&amp;amp;h=304&quot; srcset=&quot;https://hansstan.files.wordpress.com/2017/07/clip_image008_thumb1.png?w=533&amp;amp;h=304&amp;amp;zoom=2 1.5x&quot; style=&quot;background-image: none; border: 0px; display: inline; margin: 0px; max-width: 600px; padding: 0px;&quot; title=&quot;clip_image008&quot; width=&quot;533&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class=&quot;inline-ad-slot&quot; data-adtags-visited=&quot;true&quot; data-adtags-width=&quot;575&quot; id=&quot;inline-ad-2&quot; style=&quot;background-color: white; color: #555555; float: left; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; height: 0px; margin: 0px auto; overflow: hidden; padding: 0px; width: 575px;&quot;&gt;&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;After adding all the memberservers to the Group Managed Service Group&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;, they must be rebooted!&lt;/b&gt;&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;Create first gMSA Account on the DC: (max 15 chars)&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;New-ADServiceAccount IIS1SvC -DNSHostName IIS1Svc.&lt;span class=&quot;skimlinks-unlinked&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;corp.litware.com&lt;/span&gt;&amp;nbsp;-PrincipalsAllowedToRetrieveManagedPassword&amp;nbsp;&lt;/strong&gt;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span style=&quot;color: black; font-family: Calibri; font-size: small; margin: 0px; padding: 0px;&quot;&gt;gMSAGroup&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;&lt;span style=&quot;color: black; font-family: Calibri; font-size: small; margin: 0px; padding: 0px;&quot;&gt;optionally use –path to define, whe the account should be placed into the domain structure, eg:&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;-Path &quot;OU=OUXy,DC=mydomain,DC=com&quot;&lt;/span&gt;&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;Check in AD Admin Center, that the account is visible&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&lt;a href=&quot;https://hansstan.files.wordpress.com/2017/07/clip_image0101.jpg&quot; style=&quot;color: #2970a6; margin: 0px; padding: 0px; text-decoration-line: none;&quot;&gt;&lt;img alt=&quot;clip_image010&quot; border=&quot;0&quot; height=&quot;216&quot; scale=&quot;1.5&quot; src=&quot;https://hansstan.files.wordpress.com/2017/07/clip_image010_thumb1.jpg?w=466&amp;amp;h=216&quot; srcset=&quot;https://hansstan.files.wordpress.com/2017/07/clip_image010_thumb1.jpg?w=466&amp;amp;h=216&amp;amp;zoom=2 1.5x&quot; style=&quot;background-image: none; border: 0px; display: inline; margin: 0px; max-width: 600px; padding: 0px;&quot; title=&quot;clip_image010&quot; width=&quot;466&quot; /&gt;&lt;/a&gt;S&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;Switch to MemberServer (HSW2K12R2Web1)&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;Install on MemberServers: Remote Server Administration Tools via Server Manager to get Active Directory Module for Windows Powershell&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;OR with Powershell:&amp;nbsp;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;Install-WindowsFeature -Name RSAT-AD-PowerShell&lt;/strong&gt;&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;&lt;a href=&quot;https://hansstan.files.wordpress.com/2017/07/clip_image0111.png&quot; style=&quot;color: #2970a6; margin: 0px; padding: 0px; text-decoration-line: none;&quot;&gt;&lt;img alt=&quot;clip_image011&quot; border=&quot;0&quot; height=&quot;334&quot; scale=&quot;1.5&quot; src=&quot;https://hansstan.files.wordpress.com/2017/07/clip_image011_thumb1.png?w=464&amp;amp;h=334&quot; srcset=&quot;https://hansstan.files.wordpress.com/2017/07/clip_image011_thumb1.png?w=464&amp;amp;h=334&amp;amp;zoom=2 1.5x&quot; style=&quot;background-image: none; border: 0px; display: inline; margin: 0px; max-width: 600px; padding: 0px;&quot; title=&quot;clip_image011&quot; width=&quot;464&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class=&quot;inline-ad-slot&quot; data-adtags-visited=&quot;true&quot; data-adtags-width=&quot;575&quot; id=&quot;inline-ad-3&quot; style=&quot;background-color: white; color: #555555; float: left; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; height: 0px; margin: 0px auto; overflow: hidden; padding: 0px; width: 575px;&quot;&gt;&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;Open Powershell Admin Console and&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;Install-ADServiceAccount IIS1Svc&lt;/strong&gt;&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;If error is “access denied”, make sure, that the memberserver was added to the allow list of the group service group and the server was rebooted afterwards!&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;&lt;a href=&quot;https://hansstan.files.wordpress.com/2017/07/clip_image0121.png&quot; style=&quot;color: #2970a6; margin: 0px; padding: 0px; text-decoration-line: none;&quot;&gt;&lt;img alt=&quot;clip_image012&quot; border=&quot;0&quot; height=&quot;86&quot; scale=&quot;1.5&quot; src=&quot;https://hansstan.files.wordpress.com/2017/07/clip_image012_thumb1.png?w=464&amp;amp;h=86&quot; srcset=&quot;https://hansstan.files.wordpress.com/2017/07/clip_image012_thumb1.png?w=464&amp;amp;h=86&amp;amp;zoom=2 1.5x&quot; style=&quot;background-image: none; border: 0px; display: inline; margin: 0px; max-width: 600px; padding: 0px;&quot; title=&quot;clip_image012&quot; width=&quot;464&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;&lt;a href=&quot;https://hansstan.files.wordpress.com/2017/07/clip_image0131.png&quot; style=&quot;color: #2970a6; margin: 0px; padding: 0px; text-decoration-line: none;&quot;&gt;&lt;img alt=&quot;clip_image013&quot; border=&quot;0&quot; height=&quot;73&quot; scale=&quot;1.5&quot; src=&quot;https://hansstan.files.wordpress.com/2017/07/clip_image013_thumb1.png?w=465&amp;amp;h=73&quot; srcset=&quot;https://hansstan.files.wordpress.com/2017/07/clip_image013_thumb1.png?w=465&amp;amp;h=73&amp;amp;zoom=2 1.5x&quot; style=&quot;background-image: none; border: 0px; display: inline; margin: 0px; max-width: 600px; padding: 0px;&quot; title=&quot;clip_image013&quot; width=&quot;465&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;Create new AppPool in InetMgr:&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;&lt;a href=&quot;https://hansstan.files.wordpress.com/2017/07/clip_image0141.png&quot; style=&quot;color: #2970a6; margin: 0px; padding: 0px; text-decoration-line: none;&quot;&gt;&lt;img alt=&quot;clip_image014&quot; border=&quot;0&quot; height=&quot;357&quot; scale=&quot;1.5&quot; src=&quot;https://hansstan.files.wordpress.com/2017/07/clip_image014_thumb1.png?w=482&amp;amp;h=357&quot; srcset=&quot;https://hansstan.files.wordpress.com/2017/07/clip_image014_thumb1.png?w=482&amp;amp;h=357&amp;amp;zoom=2 1.5x&quot; style=&quot;background-image: none; border: 0px; display: inline; margin: 0px; max-width: 600px; padding: 0px;&quot; title=&quot;clip_image014&quot; width=&quot;482&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;Use this GroupServiceManaged Account and append “$” to the name and leave password empty&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;Use this Account for a web application.&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;When this web application will access a resource on another computer, it will then use this GMSA&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;&lt;a href=&quot;https://hansstan.files.wordpress.com/2017/07/clip_image0151.png&quot; style=&quot;color: #2970a6; margin: 0px; padding: 0px;&quot;&gt;&lt;img alt=&quot;clip_image015&quot; border=&quot;0&quot; height=&quot;260&quot; scale=&quot;1.5&quot; src=&quot;https://hansstan.files.wordpress.com/2017/07/clip_image015_thumb1.png?w=476&amp;amp;h=260&quot; srcset=&quot;https://hansstan.files.wordpress.com/2017/07/clip_image015_thumb1.png?w=476&amp;amp;h=260&amp;amp;zoom=2 1.5x&quot; style=&quot;background-image: none; border: 0px; display: inline; margin: 0px; max-width: 600px; padding: 0px;&quot; title=&quot;clip_image015&quot; width=&quot;476&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; color: #555555; font-family: Verdana, &amp;quot;BitStream vera Sans&amp;quot;, Helvetica, sans-serif; font-size: 12px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p data-adtags-visited=&quot;true&quot; style=&quot;background-color: white; margin: 0px 0px 10px; padding: 0px;&quot;&gt;&lt;span style=&quot;color: #555555; font-family: Verdana, BitStream vera Sans, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 12px;&quot;&gt;https://hansstan.wordpress.com/2017/07/05/using-group-managed-service-accounts-with-iis/&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlserverfreak.blogspot.com/feeds/2364943298427314311/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sqlserverfreak.blogspot.com/2021/03/using-group-managed-service-accounts.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/2364943298427314311'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/2364943298427314311'/><link rel='alternate' type='text/html' href='http://sqlserverfreak.blogspot.com/2021/03/using-group-managed-service-accounts.html' title='Using Group Managed Service Accounts with IIS 10 on Server 2016'/><author><name>SPK</name><uri>http://www.blogger.com/profile/07569889026692963359</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4468522590561210250.post-429286504862035215</id><published>2021-02-19T07:01:00.005-08:00</published><updated>2021-02-19T07:02:30.593-08:00</updated><title type='text'></title><content type='html'>&lt;h3 class=&quot;heading-anchor&quot; id=&quot;creating-a-non-xml-format-file&quot; style=&quot;background-color: white; box-sizing: inherit; color: #171717; font-family: &amp;quot;Segoe UI&amp;quot;, SegoeUI, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 1.75rem; line-height: 1.3; margin: 30px 0px 18px -1.875rem; outline-color: inherit; padding: 0px 0px 0px 1.875rem; position: relative;&quot;&gt;Creating a non-XML format file&lt;/h3&gt;&lt;p&gt;&lt;span face=&quot;&amp;quot;Segoe UI&amp;quot;, SegoeUI, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif&quot; style=&quot;background-color: white; color: #171717; font-size: 16px;&quot;&gt;Please review&lt;/span&gt;&lt;span face=&quot;&amp;quot;Segoe UI&amp;quot;, SegoeUI, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif&quot; style=&quot;background-color: white; color: #171717; font-size: 16px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a data-linktype=&quot;relative-path&quot; href=&quot;https://docs.microsoft.com/en-us/sql/relational-databases/import-export/non-xml-format-files-sql-server?view=sql-server-ver15&quot; style=&quot;box-sizing: inherit; cursor: pointer; font-family: &amp;quot;Segoe UI&amp;quot;, SegoeUI, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; outline-color: inherit; outline-style: initial; outline-width: 0px; overflow-wrap: break-word; text-decoration-line: none;&quot;&gt;Non-XML Format Files (SQL Server)&lt;/a&gt;&lt;span face=&quot;&amp;quot;Segoe UI&amp;quot;, SegoeUI, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif&quot; style=&quot;background-color: white; color: #171717; font-size: 16px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;Segoe UI&amp;quot;, SegoeUI, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif&quot; style=&quot;background-color: white; color: #171717; font-size: 16px;&quot;&gt;for detailed information. The following command will use the&lt;/span&gt;&lt;span face=&quot;&amp;quot;Segoe UI&amp;quot;, SegoeUI, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif&quot; style=&quot;background-color: white; color: #171717; font-size: 16px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a data-linktype=&quot;relative-path&quot; href=&quot;https://docs.microsoft.com/en-us/sql/tools/bcp-utility?view=sql-server-ver15&quot; style=&quot;box-sizing: inherit; cursor: pointer; font-family: &amp;quot;Segoe UI&amp;quot;, SegoeUI, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; outline-color: inherit; outline-style: initial; outline-width: 0px; overflow-wrap: break-word; text-decoration-line: none;&quot;&gt;bcp utility&lt;/a&gt;&lt;span face=&quot;&amp;quot;Segoe UI&amp;quot;, SegoeUI, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif&quot; style=&quot;background-color: white; color: #171717; font-size: 16px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;Segoe UI&amp;quot;, SegoeUI, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif&quot; style=&quot;background-color: white; color: #171717; font-size: 16px;&quot;&gt;to generate a non-xml format file,&lt;/span&gt;&lt;span face=&quot;&amp;quot;Segoe UI&amp;quot;, SegoeUI, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif&quot; style=&quot;background-color: white; color: #171717; font-size: 16px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;border-radius: 3px; box-sizing: inherit; color: #171717; direction: ltr; font-family: SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, Courier, monospace; font-size: 13.6px; outline-color: inherit; overflow-wrap: break-word; padding: 0.1em 0.2em;&quot;&gt;myFirstImport.fmt&lt;/code&gt;&lt;span face=&quot;&amp;quot;Segoe UI&amp;quot;, SegoeUI, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif&quot; style=&quot;background-color: white; color: #171717; font-size: 16px;&quot;&gt;, based on the schema of&lt;/span&gt;&lt;span face=&quot;&amp;quot;Segoe UI&amp;quot;, SegoeUI, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif&quot; style=&quot;background-color: white; color: #171717; font-size: 16px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;border-radius: 3px; box-sizing: inherit; color: #171717; direction: ltr; font-family: SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, Courier, monospace; font-size: 13.6px; outline-color: inherit; overflow-wrap: break-word; padding: 0.1em 0.2em;&quot;&gt;myFirstImport&lt;/code&gt;&lt;span face=&quot;&amp;quot;Segoe UI&amp;quot;, SegoeUI, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif&quot; style=&quot;background-color: white; color: #171717; font-size: 16px;&quot;&gt;. To use a bcp command to create a format file, specify the&lt;/span&gt;&lt;span face=&quot;&amp;quot;Segoe UI&amp;quot;, SegoeUI, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif&quot; style=&quot;background-color: white; color: #171717; font-size: 16px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;Segoe UI&amp;quot;, SegoeUI, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif&quot; style=&quot;box-sizing: inherit; color: #171717; font-size: 16px; font-weight: 600; outline-color: inherit;&quot;&gt;format&lt;/span&gt;&lt;span face=&quot;&amp;quot;Segoe UI&amp;quot;, SegoeUI, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif&quot; style=&quot;background-color: white; color: #171717; font-size: 16px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;Segoe UI&amp;quot;, SegoeUI, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif&quot; style=&quot;background-color: white; color: #171717; font-size: 16px;&quot;&gt;argument and use&lt;/span&gt;&lt;span face=&quot;&amp;quot;Segoe UI&amp;quot;, SegoeUI, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif&quot; style=&quot;background-color: white; color: #171717; font-size: 16px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;Segoe UI&amp;quot;, SegoeUI, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif&quot; style=&quot;box-sizing: inherit; color: #171717; font-size: 16px; font-weight: 600; outline-color: inherit;&quot;&gt;nul&lt;/span&gt;&lt;span face=&quot;&amp;quot;Segoe UI&amp;quot;, SegoeUI, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif&quot; style=&quot;background-color: white; color: #171717; font-size: 16px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;Segoe UI&amp;quot;, SegoeUI, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif&quot; style=&quot;background-color: white; color: #171717; font-size: 16px;&quot;&gt;instead of a data-file path. The format option also requires the&lt;/span&gt;&lt;span face=&quot;&amp;quot;Segoe UI&amp;quot;, SegoeUI, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif&quot; style=&quot;background-color: white; color: #171717; font-size: 16px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;Segoe UI&amp;quot;, SegoeUI, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif&quot; style=&quot;box-sizing: inherit; color: #171717; font-size: 16px; font-weight: 600; outline-color: inherit;&quot;&gt;-f&lt;/span&gt;&lt;span face=&quot;&amp;quot;Segoe UI&amp;quot;, SegoeUI, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif&quot; style=&quot;background-color: white; color: #171717; font-size: 16px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;Segoe UI&amp;quot;, SegoeUI, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif&quot; style=&quot;background-color: white; color: #171717; font-size: 16px;&quot;&gt;option. In addition, for this example, the qualifier&lt;/span&gt;&lt;span face=&quot;&amp;quot;Segoe UI&amp;quot;, SegoeUI, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif&quot; style=&quot;background-color: white; color: #171717; font-size: 16px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;Segoe UI&amp;quot;, SegoeUI, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif&quot; style=&quot;box-sizing: inherit; color: #171717; font-size: 16px; font-weight: 600; outline-color: inherit;&quot;&gt;c&lt;/span&gt;&lt;span face=&quot;&amp;quot;Segoe UI&amp;quot;, SegoeUI, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif&quot; style=&quot;background-color: white; color: #171717; font-size: 16px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;Segoe UI&amp;quot;, SegoeUI, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif&quot; style=&quot;background-color: white; color: #171717; font-size: 16px;&quot;&gt;is used to specify character data,&lt;/span&gt;&lt;span face=&quot;&amp;quot;Segoe UI&amp;quot;, SegoeUI, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif&quot; style=&quot;background-color: white; color: #171717; font-size: 16px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;Segoe UI&amp;quot;, SegoeUI, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif&quot; style=&quot;box-sizing: inherit; color: #171717; font-size: 16px; font-weight: 600; outline-color: inherit;&quot;&gt;t,&lt;/span&gt;&lt;span face=&quot;&amp;quot;Segoe UI&amp;quot;, SegoeUI, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif&quot; style=&quot;background-color: white; color: #171717; font-size: 16px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;Segoe UI&amp;quot;, SegoeUI, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif&quot; style=&quot;background-color: white; color: #171717; font-size: 16px;&quot;&gt;is used to specify a comma as a&lt;/span&gt;&lt;span face=&quot;&amp;quot;Segoe UI&amp;quot;, SegoeUI, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif&quot; style=&quot;background-color: white; color: #171717; font-size: 16px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a data-linktype=&quot;relative-path&quot; href=&quot;https://docs.microsoft.com/en-us/sql/relational-databases/import-export/specify-field-and-row-terminators-sql-server?view=sql-server-ver15&quot; style=&quot;box-sizing: inherit; cursor: pointer; font-family: &amp;quot;Segoe UI&amp;quot;, SegoeUI, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; outline-color: inherit; outline-style: initial; outline-width: 0px; overflow-wrap: break-word; text-decoration-line: none;&quot;&gt;field terminator&lt;/a&gt;&lt;span face=&quot;&amp;quot;Segoe UI&amp;quot;, SegoeUI, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif&quot; style=&quot;background-color: white; color: #171717; font-size: 16px;&quot;&gt;, and&lt;/span&gt;&lt;span face=&quot;&amp;quot;Segoe UI&amp;quot;, SegoeUI, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif&quot; style=&quot;background-color: white; color: #171717; font-size: 16px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;Segoe UI&amp;quot;, SegoeUI, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif&quot; style=&quot;box-sizing: inherit; color: #171717; font-size: 16px; font-weight: 600; outline-color: inherit;&quot;&gt;T&lt;/span&gt;&lt;span face=&quot;&amp;quot;Segoe UI&amp;quot;, SegoeUI, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif&quot; style=&quot;background-color: white; color: #171717; font-size: 16px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;Segoe UI&amp;quot;, SegoeUI, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif&quot; style=&quot;background-color: white; color: #171717; font-size: 16px;&quot;&gt;is used to specify a trusted connection using integrated security. At a command prompt, enter the following command:&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span face=&quot;SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, Courier, monospace&quot; style=&quot;background-color: #fafafa; color: #171717; font-size: 14px; white-space: pre;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span face=&quot;SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, Courier, monospace&quot; style=&quot;background-color: #fafafa; color: #171717; font-size: 14px; white-space: pre;&quot;&gt;bcp TestDatabase.dbo.myFirstImport &lt;/span&gt;&lt;span class=&quot;hljs-built_in&quot; face=&quot;SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, Courier, monospace&quot; style=&quot;background-color: #fafafa; box-sizing: inherit; color: #0101fd; font-size: 14px; outline-color: inherit; white-space: pre;&quot;&gt;format&lt;/span&gt;&lt;span face=&quot;SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, Courier, monospace&quot; style=&quot;background-color: #fafafa; color: #171717; font-size: 14px; white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hljs-built_in&quot; face=&quot;SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, Courier, monospace&quot; style=&quot;background-color: #fafafa; box-sizing: inherit; color: #0101fd; font-size: 14px; outline-color: inherit; white-space: pre;&quot;&gt;nul&lt;/span&gt;&lt;span face=&quot;SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, Courier, monospace&quot; style=&quot;background-color: #fafafa; color: #171717; font-size: 14px; white-space: pre;&quot;&gt; -c -f D:\BCP\myFirstImport.fmt -t, -T&lt;/span&gt;&lt;/p&gt;&lt;span class=&quot;hljs-comment&quot; face=&quot;SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, Courier, monospace&quot; style=&quot;background-color: #fafafa; box-sizing: inherit; color: green; font-size: 14px; outline-color: inherit; white-space: pre;&quot;&gt;
REM Review file&lt;/span&gt;&lt;span face=&quot;SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, Courier, monospace&quot; style=&quot;background-color: #fafafa; color: #171717; font-size: 14px; white-space: pre;&quot;&gt;
Notepad D:\BCP\myFirstImport.fmt&lt;/span&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;https://docs.microsoft.com/en-us/sql/relational-databases/import-export/use-a-format-file-to-bulk-import-data-sql-server?view=sql-server-ver15&amp;nbsp;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlserverfreak.blogspot.com/feeds/429286504862035215/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sqlserverfreak.blogspot.com/2021/02/creating-non-xml-format-file-please.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/429286504862035215'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/429286504862035215'/><link rel='alternate' type='text/html' href='http://sqlserverfreak.blogspot.com/2021/02/creating-non-xml-format-file-please.html' title=''/><author><name>SPK</name><uri>http://www.blogger.com/profile/07569889026692963359</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4468522590561210250.post-4720282976755567324</id><published>2021-02-09T20:53:00.001-08:00</published><updated>2021-02-09T20:55:22.841-08:00</updated><title type='text'>System.Web.HttpException: Request timed out</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;span face=&quot;Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif&quot; style=&quot;background-color: white; color: #535a60; font-size: 15px;&quot;&gt;Server Error in &#39;/&#39; Application. Request timed out. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background-color: white; border: 0px; box-sizing: inherit; clear: both; color: #535a60; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: var(--s-prose-spacing); margin-left: 0px; margin-right: 0px; margin-top: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Exception Details: System.Web.HttpException: Request timed out.&lt;/p&gt;&lt;p style=&quot;background-color: white; border: 0px; box-sizing: inherit; clear: both; color: #535a60; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: var(--s-prose-spacing); margin-left: 0px; margin-right: 0px; margin-top: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;strong style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Source Error:&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;background-color: white; border: 0px; box-sizing: inherit; clear: both; color: #535a60; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: var(--s-prose-spacing); margin-left: 0px; margin-right: 0px; margin-top: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.&lt;/p&gt;&lt;p style=&quot;background-color: white; border: 0px; box-sizing: inherit; clear: both; color: #535a60; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: var(--s-prose-spacing); margin-left: 0px; margin-right: 0px; margin-top: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;background-color: white; border: 0px; box-sizing: inherit; clear: both; color: #535a60; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: var(--s-prose-spacing); margin-left: 0px; margin-right: 0px; margin-top: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;strong style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Stack Trace:&lt;/strong&gt;&lt;/p&gt;&lt;blockquote style=&quot;background-color: white; border: 0px; box-sizing: inherit; color: #535a60; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: 0px; margin-left: 0px; padding: 0.8em 0.8em 0.8em 1em; position: relative; quotes: none; vertical-align: baseline;&quot;&gt;&lt;p style=&quot;border: 0px; box-sizing: inherit; clear: both; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;[HttpException (0x80004005): Request timed out.]&lt;/p&gt;&lt;/blockquote&gt;&lt;p style=&quot;background-color: white; border: 0px; box-sizing: inherit; clear: both; color: #242729; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: var(--s-prose-spacing); margin-left: 0px; margin-right: 0px; margin-top: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;To solve the timeout issue we can specify the request timeout (in seconds) in the web.config, like this:&lt;/p&gt;&lt;pre class=&quot;default s-code-block hljs xml&quot; style=&quot;border-radius: 5px; border: 0px; box-sizing: inherit; color: var(--highlight-color); font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: 1.30769; margin-bottom: calc(var(--s-prose-spacing) + 0.4em); margin-top: 0px; max-height: 600px; overflow-wrap: normal; overflow: auto; padding: 12px; vertical-align: baseline; width: auto;&quot;&gt;&lt;code style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;&lt;span class=&quot;hljs-tag&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;lt;&lt;span class=&quot;hljs-name&quot; color=&quot;var(--highlight-namespace)&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;httpRuntime&lt;/span&gt; &lt;span class=&quot;hljs-attr&quot; color=&quot;var(--highlight-attribute)&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;executionTimeout&lt;/span&gt;=&lt;span class=&quot;hljs-string&quot; color=&quot;var(--highlight-variable)&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;300&quot;&lt;/span&gt; /&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;background-color: white; border: 0px; box-sizing: inherit; clear: both; color: #242729; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: var(--s-prose-spacing); margin-left: 0px; margin-right: 0px; margin-top: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;For context, here&#39;s a complete&amp;nbsp;&lt;code style=&quot;background-color: var(--black-075); border-radius: 3px; border: 0px; box-sizing: inherit; color: var(--black-800); font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 2px 4px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;web.config&lt;/code&gt;&amp;nbsp;with just this setting:&lt;/p&gt;&lt;pre class=&quot;default s-code-block hljs xml&quot; style=&quot;border-radius: 5px; border: 0px; box-sizing: inherit; color: var(--highlight-color); font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: 1.30769; margin-bottom: 0px; margin-top: 0px; max-height: 600px; overflow-wrap: normal; overflow: auto; padding: 12px; vertical-align: baseline; width: auto;&quot;&gt;&lt;code style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;&lt;span class=&quot;hljs-tag&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;lt;&lt;span class=&quot;hljs-name&quot; color=&quot;var(--highlight-namespace)&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;configuration&lt;/span&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;hljs-tag&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;lt;&lt;span class=&quot;hljs-name&quot; color=&quot;var(--highlight-namespace)&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;system.web&lt;/span&gt;&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;hljs-tag&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;lt;&lt;span class=&quot;hljs-name&quot; color=&quot;var(--highlight-namespace)&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;httpRuntime&lt;/span&gt; &lt;span class=&quot;hljs-attr&quot; color=&quot;var(--highlight-attribute)&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;executionTimeout&lt;/span&gt;=&lt;span class=&quot;hljs-string&quot; color=&quot;var(--highlight-variable)&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;300&quot;&lt;/span&gt; /&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;hljs-tag&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;lt;/&lt;span class=&quot;hljs-name&quot; color=&quot;var(--highlight-namespace)&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;system.web&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre class=&quot;default s-code-block hljs xml&quot; style=&quot;border-radius: 5px; border: 0px; box-sizing: inherit; color: var(--highlight-color); font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: 1.30769; margin-bottom: 0px; margin-top: 0px; max-height: 600px; overflow-wrap: normal; overflow: auto; padding: 12px; vertical-align: baseline; width: auto;&quot;&gt;&amp;lt;/&lt;span class=&quot;hljs-name&quot; color=&quot;var(--highlight-namespace)&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;configuration&lt;/span&gt;&lt;span color=&quot;var(--highlight-color)&quot; style=&quot;font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-variant-ligatures: inherit; font-weight: inherit; white-space: inherit;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span color=&quot;var(--highlight-color)&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;default s-code-block hljs xml&quot; style=&quot;border-radius: 5px; border: 0px; box-sizing: inherit; color: var(--highlight-color); font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: 1.30769; margin-bottom: 0px; margin-top: 0px; max-height: 600px; overflow-wrap: normal; overflow: auto; padding: 12px; vertical-align: baseline; width: auto;&quot;&gt;&lt;span color=&quot;var(--highlight-color)&quot;&gt;&lt;p style=&quot;background-color: white; border: 0px; box-sizing: inherit; clear: both; color: #242729; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: var(--s-prose-spacing); margin-left: 0px; margin-right: 0px; margin-top: 0px; padding: 0px; vertical-align: baseline; white-space: normal;&quot;&gt;Also you can Open IIS -&amp;gt; click on the your siteName -&amp;gt; configuration Editor on the Section, scroll to system.web/httpRuntime. Increase the executionTimeout to the time you think it will take to execute your process.&lt;/p&gt;&lt;/span&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlserverfreak.blogspot.com/feeds/4720282976755567324/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sqlserverfreak.blogspot.com/2021/02/systemwebhttpexception-request-timed-out.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/4720282976755567324'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/4720282976755567324'/><link rel='alternate' type='text/html' href='http://sqlserverfreak.blogspot.com/2021/02/systemwebhttpexception-request-timed-out.html' title='System.Web.HttpException: Request timed out'/><author><name>SPK</name><uri>http://www.blogger.com/profile/07569889026692963359</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4468522590561210250.post-168396393416805198</id><published>2018-09-21T21:12:00.002-07:00</published><updated>2018-09-21T21:14:34.161-07:00</updated><title type='text'>SQL Server - SET XACT_ABORT  </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;-webkit-font-smoothing: antialiased; background-color: #fcfcfb; box-sizing: border-box; color: #252424; font-family: &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin: 0in 0in 0.0001pt; padding: 0px;&quot;&gt;
&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; font-size: 11pt;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-family: &amp;quot;calibri&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; font-size: 11pt;&quot;&gt;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box;&quot;&gt;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; font-weight: 700;&quot;&gt;SET XACT_ABORT &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: calibri, sans-serif; font-size: 11pt;&quot;&gt;Usually we use TRY… CATCH block of error handling where in CATCH block transaction is rolled back. But sometimes we simply use BEGIN.. COMMIT transaction without any TRY..CATCH block. In this scenario entire batch is&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;box-sizing: border-box; font-family: calibri, sans-serif; font-size: 11pt; font-weight: 700;&quot;&gt;not&lt;/span&gt;&lt;span style=&quot;font-family: calibri, sans-serif; font-size: 11pt;&quot;&gt;&amp;nbsp;rolled back.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-font-smoothing: antialiased; background-color: #fcfcfb; box-sizing: border-box; color: #252424; font-family: &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin: 0in 0in 0.0001pt; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-font-smoothing: antialiased; background-color: #fcfcfb; box-sizing: border-box; color: #252424; font-family: &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin: 0in 0in 0.0001pt; padding: 0px;&quot;&gt;
&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; font-size: 11pt;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-family: &amp;quot;calibri&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BEGIN TRANACTION&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-font-smoothing: antialiased; background-color: #fcfcfb; box-sizing: border-box; color: #252424; font-family: &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin: 0in 0in 0.0001pt; padding: 0px;&quot;&gt;
&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; font-size: 11pt;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-family: &amp;quot;calibri&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INSERT 1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-font-smoothing: antialiased; background-color: #fcfcfb; box-sizing: border-box; color: #252424; font-family: &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin: 0in 0in 0.0001pt; padding: 0px;&quot;&gt;
&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; font-size: 11pt;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-family: &amp;quot;calibri&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INSERT 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;box-sizing: border-box; color: #ef6950;&quot;&gt;--This statement failed&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-font-smoothing: antialiased; background-color: #fcfcfb; box-sizing: border-box; color: #252424; font-family: &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin: 0in 0in 0.0001pt; padding: 0px;&quot;&gt;
&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; font-size: 11pt;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-family: &amp;quot;calibri&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INSERT 3&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-font-smoothing: antialiased; background-color: #fcfcfb; box-sizing: border-box; color: #252424; font-family: &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin: 0in 0in 0.0001pt; padding: 0px;&quot;&gt;
&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; font-size: 11pt;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-family: &amp;quot;calibri&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; COMMIT TRANSACTION&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-font-smoothing: antialiased; background-color: #fcfcfb; box-sizing: border-box; color: #252424; font-family: &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin: 0in 0in 0.0001pt; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-font-smoothing: antialiased; background-color: #fcfcfb; box-sizing: border-box; color: #252424; font-family: &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin: 0in 0in 0.0001pt; padding: 0px;&quot;&gt;
&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; font-size: 11pt;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-family: &amp;quot;calibri&amp;quot; , sans-serif;&quot;&gt;In above &amp;nbsp;case INSERT 1 and INSERT 3 still executes successfully.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-font-smoothing: antialiased; background-color: #fcfcfb; box-sizing: border-box; color: #252424; font-family: &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin: 0in 0in 0.0001pt; padding: 0px;&quot;&gt;
&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; font-size: 11pt;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-family: &amp;quot;calibri&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; font-weight: 700;&quot;&gt;SET XACT_ABORT&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;-webkit-font-smoothing: antialiased; background-color: #fcfcfb; box-sizing: border-box; color: #252424; font-family: &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin-bottom: 10px; margin-left: 0px !important; margin-top: 0px;&quot;&gt;
&lt;li style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; font-size: 11pt;&quot;&gt;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-family: &amp;quot;calibri&amp;quot; , sans-serif;&quot;&gt;It is ideal for &quot;all or nothing&quot; kind of transactions.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; font-size: 11pt;&quot;&gt;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-family: &amp;quot;calibri&amp;quot; , sans-serif;&quot;&gt;It takes the whole batch as one transaction. If any of the statement in batch fails, whole batch is rolled back.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;-webkit-font-smoothing: antialiased; background-color: #fcfcfb; box-sizing: border-box; color: #252424; font-family: &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin: 0in 0in 0.0001pt; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-font-smoothing: antialiased; background-color: #fcfcfb; box-sizing: border-box; color: #252424; font-family: &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin: 0in 0in 0.0001pt; padding: 0px;&quot;&gt;
&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; font-size: 11pt;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-family: &amp;quot;calibri&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET XACT_ABORT ON&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-font-smoothing: antialiased; background-color: #fcfcfb; box-sizing: border-box; color: #252424; font-family: &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin: 0in 0in 0.0001pt; padding: 0px;&quot;&gt;
&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; font-size: 11pt;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-family: &amp;quot;calibri&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BEGIN TRANACTION&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-font-smoothing: antialiased; background-color: #fcfcfb; box-sizing: border-box; color: #252424; font-family: &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin: 0in 0in 0.0001pt; padding: 0px;&quot;&gt;
&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; font-size: 11pt;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-family: &amp;quot;calibri&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INSERT 1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-font-smoothing: antialiased; background-color: #fcfcfb; box-sizing: border-box; color: #252424; font-family: &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin: 0in 0in 0.0001pt; padding: 0px;&quot;&gt;
&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; font-size: 11pt;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-family: &amp;quot;calibri&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INSERT 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;box-sizing: border-box; color: #ef6950;&quot;&gt;--This statement failed&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-font-smoothing: antialiased; background-color: #fcfcfb; box-sizing: border-box; color: #252424; font-family: &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin: 0in 0in 0.0001pt; padding: 0px;&quot;&gt;
&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; font-size: 11pt;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-family: &amp;quot;calibri&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INSERT 3&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-font-smoothing: antialiased; background-color: #fcfcfb; box-sizing: border-box; color: #252424; font-family: &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin: 0in 0in 0.0001pt; padding: 0px;&quot;&gt;
&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; font-size: 11pt;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-family: &amp;quot;calibri&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; COMMIT TRANSACTION&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-font-smoothing: antialiased; background-color: #fcfcfb; box-sizing: border-box; color: #252424; font-family: &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin: 0in 0in 0.0001pt; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;ul style=&quot;-webkit-font-smoothing: antialiased; background-color: #fcfcfb; box-sizing: border-box; color: #252424; font-family: &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin-bottom: 10px; margin-left: 0px !important; margin-top: 0px;&quot;&gt;
&lt;li style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; font-size: 11pt;&quot;&gt;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-family: &amp;quot;calibri&amp;quot; , sans-serif;&quot;&gt;In this case INSERT 1 and INSERT 3 are also rolled back.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;-webkit-font-smoothing: antialiased; background-color: #fcfcfb; box-sizing: border-box; color: #252424; font-family: &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin: 0in 0in 0.0001pt; padding: 0px;&quot;&gt;
&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; font-size: 11pt;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-family: &amp;quot;calibri&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; font-weight: 700;&quot;&gt;Advantage&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;-webkit-font-smoothing: antialiased; background-color: #fcfcfb; box-sizing: border-box; color: #252424; font-family: &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin-bottom: 10px; margin-left: 0px !important; margin-top: 0px;&quot;&gt;
&lt;li style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; font-size: 11pt;&quot;&gt;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-family: &amp;quot;calibri&amp;quot; , sans-serif;&quot;&gt;TRY .. CATCH does not catch the schema related errors. It will return an error&amp;nbsp;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; font-weight: 700;&quot;&gt;without&lt;/span&gt;&amp;nbsp;hitting CATCH block where you have rolled back opened transaction. So You will end up with an opened transaction.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; font-size: 11pt;&quot;&gt;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-family: &amp;quot;calibri&amp;quot; , sans-serif;&quot;&gt;XCAT_ABORT rolls back transaction as soon as error occurs. So there will be no open transaction. Open transactions are major cause of performance degradation.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;-webkit-font-smoothing: antialiased; background-color: #fcfcfb; box-sizing: border-box; color: #252424; font-family: &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin: 0in 0in 0.0001pt; padding: 0px;&quot;&gt;
&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; font-size: 11pt;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-family: &amp;quot;calibri&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; font-weight: 700;&quot;&gt;Disadvantage of using with TRY .. CATCH block (For non-schema related errors)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;-webkit-font-smoothing: antialiased; background-color: #fcfcfb; box-sizing: border-box; color: #252424; font-family: &amp;quot;Segoe UI&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin-bottom: 10px; margin-left: 0px !important; margin-top: 0px;&quot;&gt;
&lt;li style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box; font-size: 11pt;&quot;&gt;&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-family: &amp;quot;calibri&amp;quot; , sans-serif;&quot;&gt;As CATCH block will not be executed, If you are handling / raising error in CATCH block. It will not be possible.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://sqlserverfreak.blogspot.com/feeds/168396393416805198/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sqlserverfreak.blogspot.com/2018/09/sql-server-set-xactabort.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/168396393416805198'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/168396393416805198'/><link rel='alternate' type='text/html' href='http://sqlserverfreak.blogspot.com/2018/09/sql-server-set-xactabort.html' title='SQL Server - SET XACT_ABORT  '/><author><name>SPK</name><uri>http://www.blogger.com/profile/07569889026692963359</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4468522590561210250.post-6325285999122314464</id><published>2018-07-27T03:13:00.001-07:00</published><updated>2018-07-27T03:13:02.157-07:00</updated><title type='text'>SQL Server Date Format conversion</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;post-text&quot; itemprop=&quot;text&quot; style=&quot;background-color: white; border: 0px; box-sizing: inherit; color: #242729; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: 1.3; margin: 0px 0px 5px; padding: 0px; vertical-align: baseline; width: 667.002px; word-wrap: break-word;&quot;&gt;
&lt;pre class=&quot;lang-sql prettyprint prettyprinted&quot; style=&quot;background-color: #eff0f1; border: 0px; box-sizing: inherit; color: #393318; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; vertical-align: baseline; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; box-sizing: inherit; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SELECT&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;convert&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;varchar&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; getdate&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(),&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; box-sizing: inherit; color: #7d2727; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;border: 0px; box-sizing: inherit; color: #858c93; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-- mon dd yyyy hh:mmAM&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SELECT&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;convert&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;varchar&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; getdate&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(),&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; box-sizing: inherit; color: #7d2727; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;101&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;border: 0px; box-sizing: inherit; color: #858c93; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-- mm/dd/yyyy – 10/02/2008                  &lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SELECT&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;convert&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;varchar&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; getdate&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(),&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; box-sizing: inherit; color: #7d2727; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;102&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;border: 0px; box-sizing: inherit; color: #858c93; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-- yyyy.mm.dd – 2008.10.02           &lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SELECT&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;convert&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;varchar&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; getdate&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(),&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; box-sizing: inherit; color: #7d2727; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;103&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;border: 0px; box-sizing: inherit; color: #858c93; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-- dd/mm/yyyy&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SELECT&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;convert&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;varchar&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; getdate&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(),&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; box-sizing: inherit; color: #7d2727; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;104&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;border: 0px; box-sizing: inherit; color: #858c93; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-- dd.mm.yyyy&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SELECT&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;convert&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;varchar&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; getdate&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(),&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; box-sizing: inherit; color: #7d2727; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;105&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;border: 0px; box-sizing: inherit; color: #858c93; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-- dd-mm-yyyy&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SELECT&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;convert&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;varchar&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; getdate&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(),&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; box-sizing: inherit; color: #7d2727; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;106&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;border: 0px; box-sizing: inherit; color: #858c93; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-- dd mon yyyy&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SELECT&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;convert&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;varchar&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; getdate&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(),&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; box-sizing: inherit; color: #7d2727; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;107&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;border: 0px; box-sizing: inherit; color: #858c93; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-- mon dd, yyyy&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SELECT&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;convert&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;varchar&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; getdate&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(),&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; box-sizing: inherit; color: #7d2727; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;108&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;border: 0px; box-sizing: inherit; color: #858c93; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-- hh:mm:ss&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SELECT&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;convert&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;varchar&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; getdate&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(),&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; box-sizing: inherit; color: #7d2727; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;109&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;border: 0px; box-sizing: inherit; color: #858c93; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-- mon dd yyyy hh:mm:ss:mmmAM (or PM)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SELECT&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;convert&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;varchar&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; getdate&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(),&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; box-sizing: inherit; color: #7d2727; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;110&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;border: 0px; box-sizing: inherit; color: #858c93; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-- mm-dd-yyyy&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SELECT&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;convert&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;varchar&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; getdate&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(),&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; box-sizing: inherit; color: #7d2727; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;111&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;border: 0px; box-sizing: inherit; color: #858c93; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-- yyyy/mm/dd&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SELECT&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;convert&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;varchar&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; getdate&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(),&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; box-sizing: inherit; color: #7d2727; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;112&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;border: 0px; box-sizing: inherit; color: #858c93; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-- yyyymmdd&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SELECT&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;convert&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;varchar&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; getdate&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(),&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; box-sizing: inherit; color: #7d2727; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;113&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;border: 0px; box-sizing: inherit; color: #858c93; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-- dd mon yyyy hh:mm:ss:mmm&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SELECT&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;convert&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;varchar&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; getdate&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(),&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; box-sizing: inherit; color: #7d2727; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;114&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;border: 0px; box-sizing: inherit; color: #858c93; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-- hh:mm:ss:mmm(24h)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SELECT&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;convert&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;varchar&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; getdate&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(),&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; box-sizing: inherit; color: #7d2727; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;120&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;border: 0px; box-sizing: inherit; color: #858c93; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-- yyyy-mm-dd hh:mm:ss(24h)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SELECT&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;convert&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;varchar&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; getdate&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(),&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; box-sizing: inherit; color: #7d2727; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;121&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;border: 0px; box-sizing: inherit; color: #858c93; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-- yyyy-mm-dd hh:mm:ss.mmm&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SELECT&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;convert&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;varchar&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; getdate&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(),&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; box-sizing: inherit; color: #7d2727; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;126&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;border: 0px; box-sizing: inherit; color: #858c93; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-- yyyy-mm-ddThh:mm:ss.mmm&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div class=&quot;grid mb0 fw-wrap ai-start jc-end gs8 gsy&quot; style=&quot;align-items: flex-start !important; background-color: white; border: 0px; box-sizing: inherit; color: #242729; display: flex; flex-wrap: wrap !important; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 13px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; justify-content: flex-end !important; line-height: inherit; margin-bottom: 0px !important; margin-left: 0px; margin-right: 0px; margin-top: -4px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;div class=&quot;grid--cell mr16&quot; style=&quot;border: 0px; box-sizing: inherit; flex: 1 1 100px; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 4px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://sqlserverfreak.blogspot.com/feeds/6325285999122314464/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sqlserverfreak.blogspot.com/2018/07/sql-server-date-format-conversion.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/6325285999122314464'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/6325285999122314464'/><link rel='alternate' type='text/html' href='http://sqlserverfreak.blogspot.com/2018/07/sql-server-date-format-conversion.html' title='SQL Server Date Format conversion'/><author><name>SPK</name><uri>http://www.blogger.com/profile/07569889026692963359</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4468522590561210250.post-746874928197977768</id><published>2018-04-18T21:55:00.003-07:00</published><updated>2018-04-18T21:55:47.094-07:00</updated><title type='text'>appcmd - to list sites using wildcard mapping</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h1 style=&quot;background-color: white; box-sizing: border-box; color: #333333; font-family: &amp;quot;Segoe UI Light&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Tahoma, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-weight: normal; line-height: 1.1; margin: 20px 0px 10px;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;You can use wildcard characters with appcmd using the following syntax:&lt;/span&gt;&lt;/h1&gt;
&lt;div class=&quot;debugCmd&quot; style=&quot;background-color: white; box-sizing: border-box; color: #333333; font-family: &amp;quot;Segoe UI&amp;quot;, Tahoma, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 14px; margin-bottom: 10px;&quot;&gt;
appcmd list apppool /name:&quot;$=*2007&quot;&lt;/div&gt;
&lt;div style=&quot;background-color: white; box-sizing: border-box; color: #333333; font-family: &amp;quot;Segoe UI&amp;quot;, Tahoma, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 14px; margin-bottom: 10px;&quot;&gt;
This command will list all application pools with a name ending in &quot;2007&quot;. Using a variation on the same method, you can find all application pools running under the identify of users in a particular domain.&lt;/div&gt;
&lt;div class=&quot;debugCmd&quot; style=&quot;background-color: white; box-sizing: border-box; color: #333333; font-family: &amp;quot;Segoe UI&amp;quot;, Tahoma, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 14px; margin-bottom: 10px;&quot;&gt;
appcmd list apppool /processModel.userName:&quot;$=MyDomain\*&quot;&lt;/div&gt;
&lt;div style=&quot;background-color: white; box-sizing: border-box; color: #333333; font-family: &amp;quot;Segoe UI&amp;quot;, Tahoma, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 14px; margin-bottom: 10px;&quot;&gt;
This will list all application pools with running with an identity of users in the &quot;MyDomain&quot; domain.&lt;/div&gt;
&lt;div style=&quot;background-color: white; box-sizing: border-box; color: #333333; font-family: &amp;quot;Segoe UI&amp;quot;, Tahoma, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 14px; margin-bottom: 10px;&quot;&gt;
appcmd list site /name:&quot;$=*cdo*&quot;&lt;/div&gt;
&lt;div style=&quot;background-color: white; box-sizing: border-box; color: #333333; font-family: &amp;quot;Segoe UI&amp;quot;, Tahoma, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 14px; margin-bottom: 10px;&quot;&gt;
This will list all sites with a name having &quot;cdo&quot;.&lt;/div&gt;
&lt;div style=&quot;background-color: white; box-sizing: border-box; color: #333333; font-family: &amp;quot;Segoe UI&amp;quot;, Tahoma, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 14px; margin-bottom: 10px;&quot;&gt;
&lt;span style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;Tip:&amp;nbsp;&lt;/span&gt;You can find out all of the attributes that can be used with appcmd by querying for help after using an attribute. For example:&lt;/div&gt;
&lt;div class=&quot;debugCmd&quot; style=&quot;background-color: white; box-sizing: border-box; color: #333333; font-family: &amp;quot;Segoe UI&amp;quot;, Tahoma, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 14px; margin-bottom: 10px;&quot;&gt;
appcmd list apppools /name:DefaultAppPool -?&lt;/div&gt;
&lt;div style=&quot;background-color: white; box-sizing: border-box; color: #333333; font-family: &amp;quot;Segoe UI&amp;quot;, Tahoma, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 14px; margin-bottom: 10px;&quot;&gt;
ERROR ( message:-name&amp;nbsp;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;-queueLength&amp;nbsp;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;-autoStart&amp;nbsp;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;-enable32BitAppOnWin64&amp;nbsp;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;-managedRuntimeVersion&amp;nbsp;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;-enableConfigurationOverride&amp;nbsp;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;-managedPipelineMode&amp;nbsp;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;-passAnonymousToken&amp;nbsp;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;-processModel.identityType&amp;nbsp;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;-processModel.userName&amp;nbsp;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;-processModel.password&amp;nbsp;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;-processModel.loadUserProfile&amp;nbsp;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;-processModel.manualGroupMembership&amp;nbsp;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;-processModel.idleTimeout&amp;nbsp;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;-processModel.maxProcesses&amp;nbsp;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;-processModel.shutdownTimeLimit&amp;nbsp;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;-processModel.startupTimeLimit&amp;nbsp;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;-processModel.pingingEnabled&amp;nbsp;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;-processModel.pingInterval&amp;nbsp;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;-processModel.pingResponseTime&amp;nbsp;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;-recycling.disallowOverlappingRotation&amp;nbsp;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;-recycling.disallowRotationOnConfigChange&amp;nbsp;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;-recycling.logEventOnRecycle&amp;nbsp;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;-recycling.periodicRestart.memory&amp;nbsp;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;-recycling.periodicRestart.privateMemory&amp;nbsp;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;-recycling.periodicRestart.requests&amp;nbsp;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;-recycling.periodicRestart.time&amp;nbsp;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;-recycling.periodicRestart.schedule.[value=&#39;timespan&#39;].value&amp;nbsp;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;-failure.loadBalancerCapabilities&amp;nbsp;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;-failure.orphanWorkerProcess&amp;nbsp;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;-failure.orphanActionExe&amp;nbsp;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;-failure.orphanActionParams&amp;nbsp;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;-failure.rapidFailProtection&amp;nbsp;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;-failure.rapidFailProtectionInterval&amp;nbsp;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;-failure.rapidFailProtectionMaxCrashes&amp;nbsp;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;-failure.autoShutdownExe&amp;nbsp;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;-failure.autoShutdownParams&amp;nbsp;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;-cpu.limit&amp;nbsp;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;-cpu.action&amp;nbsp;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;-cpu.resetInterval&amp;nbsp;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;-cpu.smpAffinitized&amp;nbsp;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;-cpu.smpProcessorAffinityMask&amp;nbsp;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;-cpu.smpProcessorAffinityMask2&amp;nbsp;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;)&lt;/div&gt;
&lt;div style=&quot;background-color: white; box-sizing: border-box; color: #333333; font-family: &amp;quot;Segoe UI&amp;quot;, Tahoma, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 14px; margin-bottom: 10px;&quot;&gt;
By appending &quot;-?&quot; to the command above, appcmd generates an error that lists all of the attributes that can be used with application pools.&lt;/div&gt;
&lt;div style=&quot;background-color: white; box-sizing: border-box; color: #333333; font-family: &amp;quot;Segoe UI&amp;quot;, Tahoma, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 14px; margin-bottom: 10px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; box-sizing: border-box; color: #333333; font-family: &amp;quot;Segoe UI&amp;quot;, Tahoma, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 14px; margin-bottom: 10px;&quot;&gt;
Source :&amp;nbsp;https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/cc771280(v%3dws.10)&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://sqlserverfreak.blogspot.com/feeds/746874928197977768/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sqlserverfreak.blogspot.com/2018/04/appcmd-to-list-sites-using-wildcard.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/746874928197977768'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/746874928197977768'/><link rel='alternate' type='text/html' href='http://sqlserverfreak.blogspot.com/2018/04/appcmd-to-list-sites-using-wildcard.html' title='appcmd - to list sites using wildcard mapping'/><author><name>SPK</name><uri>http://www.blogger.com/profile/07569889026692963359</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4468522590561210250.post-5784268772400018648</id><published>2017-11-22T00:23:00.003-08:00</published><updated>2017-11-22T02:17:03.533-08:00</updated><title type='text'>SSMS versus SQL Operations Studio</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h3&gt;
&lt;span style=&quot;background-color: white; color: #454545; font-family: &amp;quot;wol_sl&amp;quot; , &amp;quot;segoe ui&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif; font-size: 14px;&quot;&gt;&lt;b&gt;&lt;u&gt;SSMS vs SQLOpsStudio:&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&lt;token class=&quot;&quot; style=&quot;background-color: white; color: #222222;&quot;&gt;SQL Operations Studio (preview)&lt;/token&gt;&lt;span style=&quot;background-color: white; color: #222222;&quot;&gt;&amp;nbsp;is a free lightweight database development and operations tool that runs on your desktop and is available for Windows, macOS, and Linux.&amp;nbsp;&lt;/span&gt;&lt;token style=&quot;background-color: white; color: #222222;&quot;&gt;SQL Operations Studio (preview)&lt;/token&gt;&lt;span style=&quot;background-color: white; color: #222222;&quot;&gt;&amp;nbsp;has built-in support for Azure SQL Database, Azure SQL Data Warehouse, and SQL Server running on-premises or in any cloud.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;token style=&quot;background-color: white; color: #222222; font-family: segoe-ui_normal, &amp;quot;Segoe UI&amp;quot;, Segoe, &amp;quot;Segoe WP&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/token&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;token style=&quot;background-color: white; color: #222222; font-family: segoe-ui_normal, &amp;quot;Segoe UI&amp;quot;, Segoe, &amp;quot;Segoe WP&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;&quot;&gt;SQL Operations Studio (preview)&lt;/token&gt;&lt;span style=&quot;background-color: white; color: #222222;&quot;&gt;&amp;nbsp;offers a consistent experience across databases of your choice on your favorite operating systems.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; color: #454545;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;SQL Server Management Studio is a fully featured database management tool that enables most DBA’s tasks. It will continue to be the flagship tool with the data tools portfolio.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #454545;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;SQL Operations Studio enables most of the routine DBA tasks for development and operations of a database but does not have all of the functionality of SSMS.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #454545;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;SQL Operations Studio is meant to be light weight and easy to use for non-professional DBAs and thus will most likely always optimize usability and light weight to addressing all corner cases.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;background-color: white; color: #454545;&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; color: #222222;&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;Investments in flagship Windows tools (SSMS, SSDT, PowerShell) will continue in addition to the next generation of multi-OS and multi-DB CLI and GUI tools.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;background-color: white; color: #222222;&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; color: #222222;&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;The goal is to offer customers the choice of using the tools they want on the platforms of their choice for their scenarios.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;background-color: white; color: #222222;&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; color: #222222;&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;Source:&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-family: segoe-ui_normal, Segoe UI, Segoe, Segoe WP, Helvetica Neue, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&lt;a href=&quot;https://docs.microsoft.com/en-us/sql/sql-operations-studio/faq&quot;&gt;https://docs.microsoft.com/en-us/sql/sql-operations-studio/faq&amp;nbsp;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://sqlserverfreak.blogspot.com/feeds/5784268772400018648/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sqlserverfreak.blogspot.com/2017/11/ssms-versus-sql-operations-studio.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/5784268772400018648'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/5784268772400018648'/><link rel='alternate' type='text/html' href='http://sqlserverfreak.blogspot.com/2017/11/ssms-versus-sql-operations-studio.html' title='SSMS versus SQL Operations Studio'/><author><name>SPK</name><uri>http://www.blogger.com/profile/07569889026692963359</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4468522590561210250.post-3407269870346224920</id><published>2017-11-08T01:55:00.001-08:00</published><updated>2017-11-08T01:55:15.959-08:00</updated><title type='text'>Windows Batch for getting today&#39;s date </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;MsoListParagraph&quot; style=&quot;margin-left: 1in; text-align: left;&quot;&gt;
&lt;span style=&quot;color: #1f497d; font-family: &amp;quot;Verdana&amp;quot;,sans-serif; font-size: 9.0pt;&quot;&gt;for /F &quot;skip=1
delims=&quot; %%F in (&#39;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraph&quot; style=&quot;margin-left: 1in; text-align: left;&quot;&gt;
&lt;span style=&quot;color: #1f497d; font-family: &amp;quot;Verdana&amp;quot;,sans-serif; font-size: 9.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; wmic
PATH Win32_LocalTime GET Day^,Month^,Year /FORMAT:TABLE&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraph&quot; style=&quot;margin-left: 1in; text-align: left;&quot;&gt;
&lt;span style=&quot;color: #1f497d; font-family: &amp;quot;Verdana&amp;quot;,sans-serif; font-size: 9.0pt;&quot;&gt;&#39;) do (&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraph&quot; style=&quot;margin-left: 1in; text-align: left;&quot;&gt;
&lt;span style=&quot;color: #1f497d; font-family: &amp;quot;Verdana&amp;quot;,sans-serif; font-size: 9.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for /F
&quot;tokens=1-3&quot; %%L in (&quot;%%F&quot;) do (&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraph&quot; style=&quot;margin-left: 1in; text-align: left;&quot;&gt;
&lt;span style=&quot;color: #1f497d; font-family: &amp;quot;Verdana&amp;quot;,sans-serif; font-size: 9.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
set CurrDay=0%%L&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraph&quot; style=&quot;margin-left: 1in; text-align: left;&quot;&gt;
&lt;span style=&quot;color: #1f497d; font-family: &amp;quot;Verdana&amp;quot;,sans-serif; font-size: 9.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
set CurrMonth=0%%M&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraph&quot; style=&quot;margin-left: 1in; text-align: left;&quot;&gt;
&lt;span style=&quot;color: #1f497d; font-family: &amp;quot;Verdana&amp;quot;,sans-serif; font-size: 9.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
set CurrYear=%%N&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraph&quot; style=&quot;margin-left: 1in; text-align: left;&quot;&gt;
&lt;span style=&quot;color: #1f497d; font-family: &amp;quot;Verdana&amp;quot;,sans-serif; font-size: 9.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraph&quot; style=&quot;margin-left: 1in; text-align: left;&quot;&gt;
&lt;span style=&quot;color: #1f497d; font-family: &amp;quot;Verdana&amp;quot;,sans-serif; font-size: 9.0pt;&quot;&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraph&quot; style=&quot;margin-left: 1in; text-align: left;&quot;&gt;
&lt;span style=&quot;color: #1f497d; font-family: &amp;quot;Verdana&amp;quot;,sans-serif; font-size: 9.0pt;&quot;&gt;set dd=%CurrDay:~-2%&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraph&quot; style=&quot;margin-left: 1in; text-align: left;&quot;&gt;
&lt;span style=&quot;color: #1f497d; font-family: &amp;quot;Verdana&amp;quot;,sans-serif; font-size: 9.0pt;&quot;&gt;set mm=%CurrMonth:~-2%&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraph&quot; style=&quot;margin-left: 1in; text-align: left;&quot;&gt;
&lt;span style=&quot;color: #1f497d; font-family: &amp;quot;Verdana&amp;quot;,sans-serif; font-size: 9.0pt;&quot;&gt;set yyyy=%CurrYear%&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoListParagraph&quot; style=&quot;margin-left: 1in; text-align: left;&quot;&gt;
&lt;span style=&quot;color: #1f497d; font-family: &amp;quot;Verdana&amp;quot;,sans-serif; font-size: 9.0pt;&quot;&gt;set
today=%CurrYear%%CurrMonth:~-2%%CurrDay:~-2%&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://sqlserverfreak.blogspot.com/feeds/3407269870346224920/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sqlserverfreak.blogspot.com/2017/11/windows-batch-for-getting-todays-date.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/3407269870346224920'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/3407269870346224920'/><link rel='alternate' type='text/html' href='http://sqlserverfreak.blogspot.com/2017/11/windows-batch-for-getting-todays-date.html' title='Windows Batch for getting today&#39;s date '/><author><name>SPK</name><uri>http://www.blogger.com/profile/07569889026692963359</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4468522590561210250.post-3074524873818275723</id><published>2017-10-20T07:41:00.001-07:00</published><updated>2017-10-20T07:42:22.655-07:00</updated><title type='text'>SQL Logic Operator Precedence: And and Or</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; color: #242729; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: 1em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;code style=&quot;background-color: #eff0f1; border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 1px 5px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;And&lt;/code&gt;&amp;nbsp;has precedence over&amp;nbsp;&lt;code style=&quot;background-color: #eff0f1; border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 1px 5px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Or&lt;/code&gt;, so, even if&amp;nbsp;&lt;code style=&quot;background-color: #eff0f1; border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 1px 5px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;a &amp;lt;=&amp;gt; a1 Or a2&lt;/code&gt;&lt;/div&gt;
&lt;pre class=&quot;lang-sql prettyprint prettyprinted&quot; style=&quot;background-color: #eff0f1; border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; font-stretch: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; vertical-align: baseline; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Where&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; a &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;And&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; b &lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; color: #242729; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: 1em; padding: 0px; vertical-align: baseline;&quot;&gt;
is not the same as&lt;/div&gt;
&lt;pre class=&quot;lang-sql prettyprint prettyprinted&quot; style=&quot;background-color: #eff0f1; border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; font-stretch: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; vertical-align: baseline; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Where&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; a1 &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Or&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; a2 &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;And&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; b&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;,&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; color: #242729; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: 1em; padding: 0px; vertical-align: baseline;&quot;&gt;
because that would be Executed as&lt;/div&gt;
&lt;pre class=&quot;lang-sql prettyprint prettyprinted&quot; style=&quot;background-color: #eff0f1; border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; font-stretch: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; vertical-align: baseline; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Where&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; a1 &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Or&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;a2 &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;And&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; b&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; color: #242729; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: 1em; padding: 0px; vertical-align: baseline;&quot;&gt;
and what you want, to make them the same, is&lt;/div&gt;
&lt;pre class=&quot;lang-sql prettyprint prettyprinted&quot; style=&quot;background-color: #eff0f1; border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; font-stretch: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; vertical-align: baseline; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Where&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;a1 &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Or&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; a2&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;And&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; b&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; color: #242729; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: 1em; padding: 0px; vertical-align: baseline;&quot;&gt;
Here&#39;s an example to illustrate:&lt;/div&gt;
&lt;pre class=&quot;lang-sql prettyprint prettyprinted&quot; style=&quot;background-color: #eff0f1; border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; font-stretch: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; vertical-align: baseline; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Declare&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;x tinyInt &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; color: #7d2727; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Declare&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;y tinyInt &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; color: #7d2727; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Declare&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;z tinyInt &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; color: #7d2727; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Select&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Case&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;When&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; color: #7d2727; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;OR&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; color: #7d2727; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;And&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;z&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; color: #7d2727; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Then&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; color: #7d2727; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&#39;T&#39;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Else&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; color: #7d2727; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&#39;F&#39;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;End&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;border: 0px; color: #858c93; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-- outputs T&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Select&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Case&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;When&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(@&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; color: #7d2727; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;OR&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; color: #7d2727; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;And&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;z&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; color: #7d2727; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Then&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; color: #7d2727; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&#39;T&#39;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Else&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; color: #7d2727; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&#39;F&#39;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;End&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;border: 0px; color: #858c93; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-- outputs F&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://sqlserverfreak.blogspot.com/feeds/3074524873818275723/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sqlserverfreak.blogspot.com/2017/10/sql-logic-operator-precedence-and-and-or.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/3074524873818275723'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/3074524873818275723'/><link rel='alternate' type='text/html' href='http://sqlserverfreak.blogspot.com/2017/10/sql-logic-operator-precedence-and-and-or.html' title='SQL Logic Operator Precedence: And and Or'/><author><name>SPK</name><uri>http://www.blogger.com/profile/07569889026692963359</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4468522590561210250.post-1418405102197726785</id><published>2017-07-24T00:53:00.001-07:00</published><updated>2017-07-26T04:33:16.517-07:00</updated><title type='text'>How to disable Data Compression on tables in whole database in SQL Server 2008R2?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;font_8 color_15&quot; data-reactid=&quot;.0.$SITE_ROOT.$desktop_siteRoot.$PAGES_CONTAINER.$centeredContent.$inlineContent.$SITE_PAGES.$genjk_DESKTOP.$inlineContent.$comp-imd7uf3w.$inlineContent.0.$child.$0.$inlineContent.$1.$5.$0.$richTextContainer.0&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; color: #2f2e2e; font-family: &amp;quot;libre baskerville&amp;quot;, serif; font-size: 16px; font-stretch: normal; line-height: 1.5em; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;span data-reactid=&quot;.0.$SITE_ROOT.$desktop_siteRoot.$PAGES_CONTAINER.$centeredContent.$inlineContent.$SITE_PAGES.$genjk_DESKTOP.$inlineContent.$comp-imd7uf3w.$inlineContent.0.$child.$0.$inlineContent.$1.$5.$0.$richTextContainer.0.0&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;If you restore database from enterprise edition to Standard&amp;nbsp;edition and you have enabled &quot;Data compression&quot; on table, restoration fails. Data compression is available only&amp;nbsp;Enterprise edition in SQL Server 2008R2. The best way how to disable data compression is the following:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;font_8 color_15&quot; data-reactid=&quot;.0.$SITE_ROOT.$desktop_siteRoot.$PAGES_CONTAINER.$centeredContent.$inlineContent.$SITE_PAGES.$genjk_DESKTOP.$inlineContent.$comp-imd7uf3w.$inlineContent.0.$child.$0.$inlineContent.$1.$5.$0.$richTextContainer.1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; color: #2f2e2e; font-family: &amp;quot;libre baskerville&amp;quot;, serif; font-size: 16px; font-stretch: normal; line-height: 1.5em; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;font_8 color_15&quot; data-reactid=&quot;.0.$SITE_ROOT.$desktop_siteRoot.$PAGES_CONTAINER.$centeredContent.$inlineContent.$SITE_PAGES.$genjk_DESKTOP.$inlineContent.$comp-imd7uf3w.$inlineContent.0.$child.$0.$inlineContent.$1.$5.$0.$richTextContainer.2&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; color: #2f2e2e; font-family: &amp;quot;libre baskerville&amp;quot;, serif; font-size: 16px; font-stretch: normal; line-height: 1.5em; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;span data-reactid=&quot;.0.$SITE_ROOT.$desktop_siteRoot.$PAGES_CONTAINER.$centeredContent.$inlineContent.$SITE_PAGES.$genjk_DESKTOP.$inlineContent.$comp-imd7uf3w.$inlineContent.0.$child.$0.$inlineContent.$1.$5.$0.$richTextContainer.2.0&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span data-reactid=&quot;.0.$SITE_ROOT.$desktop_siteRoot.$PAGES_CONTAINER.$centeredContent.$inlineContent.$SITE_PAGES.$genjk_DESKTOP.$inlineContent.$comp-imd7uf3w.$inlineContent.0.$child.$0.$inlineContent.$1.$5.$0.$richTextContainer.2.0.0&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span data-reactid=&quot;.0.$SITE_ROOT.$desktop_siteRoot.$PAGES_CONTAINER.$centeredContent.$inlineContent.$SITE_PAGES.$genjk_DESKTOP.$inlineContent.$comp-imd7uf3w.$inlineContent.0.$child.$0.$inlineContent.$1.$5.$0.$richTextContainer.2.0.0.0&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span data-reactid=&quot;.0.$SITE_ROOT.$desktop_siteRoot.$PAGES_CONTAINER.$centeredContent.$inlineContent.$SITE_PAGES.$genjk_DESKTOP.$inlineContent.$comp-imd7uf3w.$inlineContent.0.$child.$0.$inlineContent.$1.$5.$0.$richTextContainer.2.0.0.0.0&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; font-weight: bold; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;1) make a clone of your database where data compression is enabled&amp;nbsp;on enterprise&amp;nbsp;edition&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;font_8 color_15&quot; data-reactid=&quot;.0.$SITE_ROOT.$desktop_siteRoot.$PAGES_CONTAINER.$centeredContent.$inlineContent.$SITE_PAGES.$genjk_DESKTOP.$inlineContent.$comp-imd7uf3w.$inlineContent.0.$child.$0.$inlineContent.$1.$5.$0.$richTextContainer.3&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; color: #2f2e2e; font-family: &amp;quot;libre baskerville&amp;quot;, serif; font-size: 16px; font-stretch: normal; line-height: 1.5em; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;font_8 color_15&quot; data-reactid=&quot;.0.$SITE_ROOT.$desktop_siteRoot.$PAGES_CONTAINER.$centeredContent.$inlineContent.$SITE_PAGES.$genjk_DESKTOP.$inlineContent.$comp-imd7uf3w.$inlineContent.0.$child.$0.$inlineContent.$1.$5.$0.$richTextContainer.4&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; color: #2f2e2e; font-family: &amp;quot;libre baskerville&amp;quot;, serif; font-size: 16px; font-stretch: normal; line-height: 1.5em; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;span data-reactid=&quot;.0.$SITE_ROOT.$desktop_siteRoot.$PAGES_CONTAINER.$centeredContent.$inlineContent.$SITE_PAGES.$genjk_DESKTOP.$inlineContent.$comp-imd7uf3w.$inlineContent.0.$child.$0.$inlineContent.$1.$5.$0.$richTextContainer.4.0&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span data-reactid=&quot;.0.$SITE_ROOT.$desktop_siteRoot.$PAGES_CONTAINER.$centeredContent.$inlineContent.$SITE_PAGES.$genjk_DESKTOP.$inlineContent.$comp-imd7uf3w.$inlineContent.0.$child.$0.$inlineContent.$1.$5.$0.$richTextContainer.4.0.0&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span data-reactid=&quot;.0.$SITE_ROOT.$desktop_siteRoot.$PAGES_CONTAINER.$centeredContent.$inlineContent.$SITE_PAGES.$genjk_DESKTOP.$inlineContent.$comp-imd7uf3w.$inlineContent.0.$child.$0.$inlineContent.$1.$5.$0.$richTextContainer.4.0.0.0&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span data-reactid=&quot;.0.$SITE_ROOT.$desktop_siteRoot.$PAGES_CONTAINER.$centeredContent.$inlineContent.$SITE_PAGES.$genjk_DESKTOP.$inlineContent.$comp-imd7uf3w.$inlineContent.0.$child.$0.$inlineContent.$1.$5.$0.$richTextContainer.4.0.0.0.0&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; font-weight: bold; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;2) then run this script on clone database&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;font_8 color_15&quot; data-reactid=&quot;.0.$SITE_ROOT.$desktop_siteRoot.$PAGES_CONTAINER.$centeredContent.$inlineContent.$SITE_PAGES.$genjk_DESKTOP.$inlineContent.$comp-imd7uf3w.$inlineContent.0.$child.$0.$inlineContent.$1.$5.$0.$richTextContainer.5&quot; style=&quot;border: 0px; font-stretch: normal; line-height: 1.5em; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;color: #2f2e2e; font-family: libre baskerville, serif;&quot;&gt;SELECT&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2f2e2e; font-family: libre baskerville, serif;&quot;&gt;SCHEMA_NAME(sys.objects.schema_id) AS [SchemaName]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2f2e2e; font-family: libre baskerville, serif;&quot;&gt;,OBJECT_NAME(sys.objects.object_id) AS [ObjectName]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2f2e2e; font-family: libre baskerville, serif;&quot;&gt;,[rows]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2f2e2e; font-family: libre baskerville, serif;&quot;&gt;,[data_compression_desc]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2f2e2e; font-family: libre baskerville, serif;&quot;&gt;,[index_id] as [IndexID_on_Table]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2f2e2e; font-family: libre baskerville, serif;&quot;&gt;into #compr&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2f2e2e; font-family: libre baskerville, serif;&quot;&gt;FROM sys.partitions&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2f2e2e; font-family: libre baskerville, serif;&quot;&gt;INNER JOIN sys.objects&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2f2e2e; font-family: libre baskerville, serif;&quot;&gt;ON sys.partitions.object_id = sys.objects.object_id&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2f2e2e; font-family: libre baskerville, serif;&quot;&gt;WHERE data_compression &amp;gt; 0&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2f2e2e; font-family: libre baskerville, serif;&quot;&gt;AND SCHEMA_NAME(sys.objects.schema_id) &amp;lt;&amp;gt; &#39;SYS&#39;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2f2e2e; font-family: libre baskerville, serif;&quot;&gt;while exists(select 1 from #compr)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2f2e2e; font-family: libre baskerville, serif;&quot;&gt;begin&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2f2e2e; font-family: libre baskerville, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; declare @i varchar(200) = (select top 1 [ObjectName] from #compr)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2f2e2e; font-family: libre baskerville, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; print @i&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2f2e2e; font-family: libre baskerville, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;exec (&#39;ALTER INDEX ALL ON &#39;+@i + &#39; REBUILD WITH (DATA_COMPRESSION = None)&#39;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2f2e2e; font-family: libre baskerville, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;delete from #compr where [ObjectName] = @i&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2f2e2e; font-family: libre baskerville, serif;&quot;&gt;end&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2f2e2e; font-family: libre baskerville, serif;&quot;&gt;drop table #compr&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2f2e2e; font-family: libre baskerville, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;font_8 color_15&quot; data-reactid=&quot;.0.$SITE_ROOT.$desktop_siteRoot.$PAGES_CONTAINER.$centeredContent.$inlineContent.$SITE_PAGES.$genjk_DESKTOP.$inlineContent.$comp-imd7uf3w.$inlineContent.0.$child.$0.$inlineContent.$1.$5.$0.$richTextContainer.b&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; color: #2f2e2e; font-family: &amp;quot;libre baskerville&amp;quot;, serif; font-size: 16px; font-stretch: normal; line-height: 1.5em; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;span data-reactid=&quot;.0.$SITE_ROOT.$desktop_siteRoot.$PAGES_CONTAINER.$centeredContent.$inlineContent.$SITE_PAGES.$genjk_DESKTOP.$inlineContent.$comp-imd7uf3w.$inlineContent.0.$child.$0.$inlineContent.$1.$5.$0.$richTextContainer.b.0&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span data-reactid=&quot;.0.$SITE_ROOT.$desktop_siteRoot.$PAGES_CONTAINER.$centeredContent.$inlineContent.$SITE_PAGES.$genjk_DESKTOP.$inlineContent.$comp-imd7uf3w.$inlineContent.0.$child.$0.$inlineContent.$1.$5.$0.$richTextContainer.b.0.0&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span data-reactid=&quot;.0.$SITE_ROOT.$desktop_siteRoot.$PAGES_CONTAINER.$centeredContent.$inlineContent.$SITE_PAGES.$genjk_DESKTOP.$inlineContent.$comp-imd7uf3w.$inlineContent.0.$child.$0.$inlineContent.$1.$5.$0.$richTextContainer.b.0.0.0&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span data-reactid=&quot;.0.$SITE_ROOT.$desktop_siteRoot.$PAGES_CONTAINER.$centeredContent.$inlineContent.$SITE_PAGES.$genjk_DESKTOP.$inlineContent.$comp-imd7uf3w.$inlineContent.0.$child.$0.$inlineContent.$1.$5.$0.$richTextContainer.b.0.0.0.0&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; font-weight: bold; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;3) now you can backup clone database and restore on Standard edition&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://sqlserverfreak.blogspot.com/feeds/1418405102197726785/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sqlserverfreak.blogspot.com/2017/07/how-to-disable-data-compression-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/1418405102197726785'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/1418405102197726785'/><link rel='alternate' type='text/html' href='http://sqlserverfreak.blogspot.com/2017/07/how-to-disable-data-compression-on.html' title='How to disable Data Compression on tables in whole database in SQL Server 2008R2?'/><author><name>SPK</name><uri>http://www.blogger.com/profile/07569889026692963359</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4468522590561210250.post-7124819971128544586</id><published>2017-03-10T02:30:00.002-08:00</published><updated>2017-03-10T02:30:54.042-08:00</updated><title type='text'>How do you drop a default constraint in T-SQL ? </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;pre class=&quot;lang-sql prettyprint prettyprinted&quot; style=&quot;background-color: #eff0f1; border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;DECLARE&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;tableName VARCHAR&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;MAX&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&#39;&amp;lt;MYTABLENAME&amp;gt;&#39;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;DECLARE&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;columnName VARCHAR&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;MAX&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&#39;&amp;lt;MYCOLUMNAME&amp;gt;&#39;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;DECLARE&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;ConstraintName nvarchar&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;SELECT&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;ConstraintName &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; Name 
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;FROM&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; SYS&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;DEFAULT_CONSTRAINTS
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;WHERE&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; PARENT_OBJECT_ID &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; OBJECT_ID&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(@&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;tableName&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; 
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;AND&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; PARENT_COLUMN_ID &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;SELECT&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; column_id &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;FROM&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; sys&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;columns
    &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;WHERE&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; NAME &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;columnName &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;AND&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; object_id &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; OBJECT_ID&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(@&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;tableName&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;IF&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;ConstraintName &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;IS&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;NOT&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;NULL&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;EXEC&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&#39;ALTER TABLE &#39;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;+@&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;tableName&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&#39; DROP CONSTRAINT &#39;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;ConstraintName&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; color: #242729; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; margin-bottom: 1em; padding: 0px;&quot;&gt;
Just replace&amp;nbsp;&lt;code style=&quot;background-color: #eff0f1; border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; margin: 0px; padding: 1px 5px; white-space: pre-wrap;&quot;&gt;&amp;lt;MYTABLENAME&amp;gt;&lt;/code&gt;&amp;nbsp;and&amp;nbsp;&lt;code style=&quot;background-color: #eff0f1; border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; margin: 0px; padding: 1px 5px; white-space: pre-wrap;&quot;&gt;&amp;lt;MYCOLUMNNAME&amp;gt;&lt;/code&gt;&amp;nbsp;as appropriate.&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://sqlserverfreak.blogspot.com/feeds/7124819971128544586/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sqlserverfreak.blogspot.com/2017/03/how-do-you-drop-default-constraint-in-t.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/7124819971128544586'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/7124819971128544586'/><link rel='alternate' type='text/html' href='http://sqlserverfreak.blogspot.com/2017/03/how-do-you-drop-default-constraint-in-t.html' title='How do you drop a default constraint in T-SQL ? '/><author><name>SPK</name><uri>http://www.blogger.com/profile/07569889026692963359</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4468522590561210250.post-1003157260192559855</id><published>2016-06-05T08:28:00.000-07:00</published><updated>2016-06-05T08:28:36.465-07:00</updated><title type='text'></title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;header class=&quot;entry-header single&quot; style=&quot;background-color: white; box-sizing: border-box; color: #333333; font-family: &amp;quot;Segoe UI&amp;quot;, Tahoma, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 14px; line-height: 20px;&quot;&gt;&lt;h1 class=&quot;entry-title&quot; style=&quot;box-sizing: border-box; color: inherit; font-family: &amp;quot;Segoe UI Light&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Tahoma, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 36px; font-weight: normal; line-height: 1.1; margin: 20px 0px 10px; word-wrap: break-word;&quot;&gt;
SQLCMD and the power of the little r&lt;/h1&gt;
&lt;h1 class=&quot;entry-title&quot; style=&quot;box-sizing: border-box; color: inherit; font-family: &amp;quot;Segoe UI Light&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Tahoma, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 36px; font-weight: normal; line-height: 1.1; margin: 20px 0px 10px; word-wrap: break-word;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;segoe ui&amp;quot;, tahoma, arial, &amp;quot;helvetica neue&amp;quot;, helvetica, sans-serif; font-size: 14px; line-height: 20px;&quot;&gt;I would have to say that one of my favorite new utilities that shipped with&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;segoe ui&amp;quot;, tahoma, arial, &amp;quot;helvetica neue&amp;quot;, helvetica, sans-serif; font-size: 14px; line-height: 20px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/ms170207.aspx&quot; style=&quot;background-color: transparent; box-sizing: border-box; color: #337ab7; font-family: &amp;quot;segoe ui&amp;quot;, tahoma, arial, &amp;quot;helvetica neue&amp;quot;, helvetica, sans-serif; font-size: 14px; line-height: 20px; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;SQL Server 2005 has been the SQLCMD utility&lt;/a&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;segoe ui&amp;quot;, tahoma, arial, &amp;quot;helvetica neue&amp;quot;, helvetica, sans-serif; font-size: 14px; line-height: 20px;&quot;&gt;.&amp;nbsp; I am going to demonstrate the use of include files. The following is the complete call syntax for SQLCMD.&lt;/span&gt;&lt;/h1&gt;
&lt;div class=&quot;clear-both&quot; style=&quot;box-sizing: border-box; clear: both;&quot;&gt;
&lt;/div&gt;
&lt;/header&gt;&lt;br /&gt;
&lt;div class=&quot;entry-content single&quot; style=&quot;background-color: white; box-sizing: border-box; color: #333333; font-family: &amp;quot;Segoe UI&amp;quot;, Tahoma, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 14px; line-height: 20px; overflow: hidden;&quot;&gt;
&lt;div style=&quot;box-sizing: border-box;&quot;&gt;
&lt;div style=&quot;background-color: #f4f4f4; border-style: none; box-sizing: border-box; color: black; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; overflow: visible; padding: 0px; width: 855px;&quot;&gt;
&lt;pre style=&quot;background-color: white; border-radius: 4px; border: 1px none rgb(204, 204, 204); box-sizing: border-box; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 855px; word-break: break-all; word-wrap: break-word;&quot;&gt;sqlcmd &lt;/pre&gt;
&lt;pre style=&quot;border-radius: 4px; border: 1px none rgb(204, 204, 204); box-sizing: border-box; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 855px; word-break: break-all; word-wrap: break-word;&quot;&gt;[{ { -U login_id [ -P password ] } | –E trusted &lt;span style=&quot;box-sizing: border-box; color: blue;&quot;&gt;connection&lt;/span&gt; }] &lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-radius: 4px; border: 1px none rgb(204, 204, 204); box-sizing: border-box; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 855px; word-break: break-all; word-wrap: break-word;&quot;&gt;[ -z &lt;span style=&quot;box-sizing: border-box; color: blue;&quot;&gt;new&lt;/span&gt; password ] [ -Z &lt;span style=&quot;box-sizing: border-box; color: blue;&quot;&gt;new&lt;/span&gt; password &lt;span style=&quot;box-sizing: border-box; color: blue;&quot;&gt;and&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box; color: blue;&quot;&gt;exit&lt;/span&gt;]&lt;/pre&gt;
&lt;pre style=&quot;border-radius: 4px; border: 1px none rgb(204, 204, 204); box-sizing: border-box; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 855px; word-break: break-all; word-wrap: break-word;&quot;&gt;[ -S server_name [ \ instance_name ] ] [ -H wksta_name ] [ -d db_name ]&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-radius: 4px; border: 1px none rgb(204, 204, 204); box-sizing: border-box; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 855px; word-break: break-all; word-wrap: break-word;&quot;&gt;[ -l login time_out ] [ -A dedicated &lt;span style=&quot;box-sizing: border-box; color: blue;&quot;&gt;admin&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box; color: blue;&quot;&gt;connection&lt;/span&gt; ] &lt;/pre&gt;
&lt;pre style=&quot;border-radius: 4px; border: 1px none rgb(204, 204, 204); box-sizing: border-box; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 855px; word-break: break-all; word-wrap: break-word;&quot;&gt;[ -i input_file ] [ -o output_file ]&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-radius: 4px; border: 1px none rgb(204, 204, 204); box-sizing: border-box; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 855px; word-break: break-all; word-wrap: break-word;&quot;&gt;[ -f &amp;lt; codepage &amp;gt; | i: &amp;lt; codepage &amp;gt; [ &amp;lt; , o: &amp;lt; codepage &amp;gt; ] ]&lt;/pre&gt;
&lt;pre style=&quot;border-radius: 4px; border: 1px none rgb(204, 204, 204); box-sizing: border-box; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 855px; word-break: break-all; word-wrap: break-word;&quot;&gt;[ -u unicode &lt;span style=&quot;box-sizing: border-box; color: blue;&quot;&gt;output&lt;/span&gt; ] [ -r [ 0 | 1 ] msgs &lt;span style=&quot;box-sizing: border-box; color: blue;&quot;&gt;to&lt;/span&gt; stderr ] &lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-radius: 4px; border: 1px none rgb(204, 204, 204); box-sizing: border-box; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 855px; word-break: break-all; word-wrap: break-word;&quot;&gt;[ -R &lt;span style=&quot;box-sizing: border-box; color: blue;&quot;&gt;use&lt;/span&gt; client regional settings ]&lt;/pre&gt;
&lt;pre style=&quot;border-radius: 4px; border: 1px none rgb(204, 204, 204); box-sizing: border-box; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 855px; word-break: break-all; word-wrap: break-word;&quot;&gt;[ -q &quot;cmdline query&quot; ] [ -Q &quot;cmdline query&quot; &lt;span style=&quot;box-sizing: border-box; color: blue;&quot;&gt;and&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box; color: blue;&quot;&gt;exit&lt;/span&gt; ] &lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-radius: 4px; border: 1px none rgb(204, 204, 204); box-sizing: border-box; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 855px; word-break: break-all; word-wrap: break-word;&quot;&gt;[ -e echo &lt;span style=&quot;box-sizing: border-box; color: blue;&quot;&gt;input&lt;/span&gt; ] [ -t query time_out ] &lt;/pre&gt;
&lt;pre style=&quot;border-radius: 4px; border: 1px none rgb(204, 204, 204); box-sizing: border-box; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 855px; word-break: break-all; word-wrap: break-word;&quot;&gt;[ -I enable Quoted Identifiers ] &lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-radius: 4px; border: 1px none rgb(204, 204, 204); box-sizing: border-box; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 855px; word-break: break-all; word-wrap: break-word;&quot;&gt;[ -v var = &quot;&lt;span style=&quot;box-sizing: border-box; color: blue;&quot;&gt;value&lt;/span&gt;&quot;...] [ -x disable &lt;span style=&quot;box-sizing: border-box; color: blue;&quot;&gt;variable&lt;/span&gt; substitution ]&lt;/pre&gt;
&lt;pre style=&quot;border-radius: 4px; border: 1px none rgb(204, 204, 204); box-sizing: border-box; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 855px; word-break: break-all; word-wrap: break-word;&quot;&gt;[ -h headers ][ -s col_separator ] [ -w column_width ] &lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-radius: 4px; border: 1px none rgb(204, 204, 204); box-sizing: border-box; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 855px; word-break: break-all; word-wrap: break-word;&quot;&gt;[ -W remove &lt;span style=&quot;box-sizing: border-box; color: blue;&quot;&gt;trailing&lt;/span&gt; spaces ]&lt;/pre&gt;
&lt;pre style=&quot;border-radius: 4px; border: 1px none rgb(204, 204, 204); box-sizing: border-box; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 855px; word-break: break-all; word-wrap: break-word;&quot;&gt;[ -k [ 1 | 2 ] remove[replace] control characters ] &lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-radius: 4px; border: 1px none rgb(204, 204, 204); box-sizing: border-box; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 855px; word-break: break-all; word-wrap: break-word;&quot;&gt;[ -y display_width ] [-Y display_width ]&lt;/pre&gt;
&lt;pre style=&quot;border-radius: 4px; border: 1px none rgb(204, 204, 204); box-sizing: border-box; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 855px; word-break: break-all; word-wrap: break-word;&quot;&gt;[ -b &lt;span style=&quot;box-sizing: border-box; color: blue;&quot;&gt;on&lt;/span&gt; error batch abort ] [ -V severitylevel ] [ -m error_level ] &lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-radius: 4px; border: 1px none rgb(204, 204, 204); box-sizing: border-box; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 855px; word-break: break-all; word-wrap: break-word;&quot;&gt;[ -a packet_size ][ -c cmd_end ] &lt;/pre&gt;
&lt;pre style=&quot;border-radius: 4px; border: 1px none rgb(204, 204, 204); box-sizing: border-box; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 855px; word-break: break-all; word-wrap: break-word;&quot;&gt;[ -L [ c ] list servers[clean &lt;span style=&quot;box-sizing: border-box; color: blue;&quot;&gt;output&lt;/span&gt;] ] &lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-radius: 4px; border: 1px none rgb(204, 204, 204); box-sizing: border-box; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 855px; word-break: break-all; word-wrap: break-word;&quot;&gt;[ -p [ 1 ] &lt;span style=&quot;box-sizing: border-box; color: blue;&quot;&gt;print&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box; color: blue;&quot;&gt;statistics&lt;/span&gt;[colon format] ] &lt;/pre&gt;
&lt;pre style=&quot;border-radius: 4px; border: 1px none rgb(204, 204, 204); box-sizing: border-box; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 855px; word-break: break-all; word-wrap: break-word;&quot;&gt;[ -X [ 1 ] ] disable commands, startup script, enviroment variables [&lt;span style=&quot;box-sizing: border-box; color: blue;&quot;&gt;and&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box; color: blue;&quot;&gt;exit&lt;/span&gt;] &lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-radius: 4px; border: 1px none rgb(204, 204, 204); box-sizing: border-box; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 855px; word-break: break-all; word-wrap: break-word;&quot;&gt;[ -? show syntax summary ]&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;box-sizing: border-box; margin-bottom: 10px;&quot;&gt;
:r is a SQLCMD command that parses additional Transact-SQL statements and sqlcmd commands from the file specified by &amp;lt;filename&amp;gt; into the statement cache.&lt;/div&gt;
&lt;div style=&quot;box-sizing: border-box; margin-bottom: 10px;&quot;&gt;
A simple example:&lt;/div&gt;
&lt;div style=&quot;box-sizing: border-box; margin-bottom: 10px;&quot;&gt;
In&amp;nbsp;SQLQuery1.sql I have the following:&lt;/div&gt;
&lt;div style=&quot;box-sizing: border-box;&quot;&gt;
&lt;div style=&quot;background-color: #f4f4f4; border-style: none; box-sizing: border-box; color: black; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; overflow: visible; padding: 0px; width: 855px;&quot;&gt;
SELECT TOP 5 ProductID,Name,ProductNumber,MakeFlag FROM AdventureWorks.Production.Product&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;box-sizing: border-box; margin-bottom: 10px;&quot;&gt;
In SQLQuery2.sql I can then reference SQL file 1 as follows:&lt;/div&gt;
&lt;div style=&quot;box-sizing: border-box; margin-bottom: 10px;&quot;&gt;
:r “c:\SQLQuery1.sql”&lt;/div&gt;
&lt;div style=&quot;box-sizing: border-box; margin-bottom: 10px;&quot;&gt;
My results are:&lt;/div&gt;
&lt;div style=&quot;box-sizing: border-box; margin-bottom: 10px;&quot;&gt;
ProductID&amp;nbsp;&amp;nbsp;&amp;nbsp; Name&amp;nbsp;&amp;nbsp;&amp;nbsp; ProductNumber&amp;nbsp;&amp;nbsp;&amp;nbsp; MakeFlag&lt;br /&gt;
1&amp;nbsp;&amp;nbsp;&amp;nbsp; Adjustable Race&amp;nbsp;&amp;nbsp;&amp;nbsp; AR-5381&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;br /&gt;
2&amp;nbsp;&amp;nbsp;&amp;nbsp; Bearing Ball&amp;nbsp;&amp;nbsp;&amp;nbsp; BA-8327&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;br /&gt;
3&amp;nbsp;&amp;nbsp;&amp;nbsp; BB Ball Bearing&amp;nbsp;&amp;nbsp;&amp;nbsp; BE-2349&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;br /&gt;
4&amp;nbsp;&amp;nbsp;&amp;nbsp; Headset Ball Bearings&amp;nbsp;&amp;nbsp;&amp;nbsp; BE-2908&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;br /&gt;
316&amp;nbsp;&amp;nbsp;&amp;nbsp; Blade&amp;nbsp;&amp;nbsp;&amp;nbsp; BL-2036&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/div&gt;
&lt;div style=&quot;box-sizing: border-box; margin-bottom: 10px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;box-sizing: border-box; margin-bottom: 10px;&quot;&gt;
This may not seem like a big deal, but consider the following scenario. I have a large bat file of SQL that I process in jobs or in SSIS packages. This bat file is doing and setting the same variables over and over again, so I can create include files that declare my variables, and another include file that sets them.&lt;/div&gt;
&lt;div style=&quot;box-sizing: border-box; margin-bottom: 10px;&quot;&gt;
My first file “c:\DeclareVariables.sql” will always change me to the correct DB, set no count on and declare my variables. This becomes&amp;nbsp; good anchor file for any pre-processing that I may want to do.&lt;/div&gt;
&lt;div style=&quot;box-sizing: border-box;&quot;&gt;
&lt;div style=&quot;background-color: #f4f4f4; border-style: none; box-sizing: border-box; color: black; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; overflow: visible; padding: 0px; width: 855px;&quot;&gt;
&lt;pre style=&quot;background-color: white; border-radius: 4px; border: 1px none rgb(204, 204, 204); box-sizing: border-box; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 855px; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; color: blue;&quot;&gt;USE&lt;/span&gt; [AdventureWorks]&lt;/pre&gt;
&lt;pre style=&quot;border-radius: 4px; border: 1px none rgb(204, 204, 204); box-sizing: border-box; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 855px; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; color: blue;&quot;&gt;GO&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-radius: 4px; border: 1px none rgb(204, 204, 204); box-sizing: border-box; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 855px; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; color: blue;&quot;&gt;SET&lt;/span&gt; NOCOUNT &lt;span style=&quot;box-sizing: border-box; color: blue;&quot;&gt;ON&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;border-radius: 4px; border: 1px none rgb(204, 204, 204); box-sizing: border-box; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 855px; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; color: blue;&quot;&gt;GO&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-radius: 4px; border: 1px none rgb(204, 204, 204); box-sizing: border-box; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 855px; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; color: blue;&quot;&gt;DECLARE&lt;/span&gt; @AccountingStartDate smalldatetime;&lt;/pre&gt;
&lt;pre style=&quot;border-radius: 4px; border: 1px none rgb(204, 204, 204); box-sizing: border-box; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 855px; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; color: blue;&quot;&gt;DECLARE&lt;/span&gt; @AccountingEndDate smalldatetime;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-radius: 4px; border: 1px none rgb(204, 204, 204); box-sizing: border-box; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 855px; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; color: blue;&quot;&gt;DECLARE&lt;/span&gt; @DocumentStatusText &lt;span style=&quot;box-sizing: border-box; color: blue;&quot;&gt;varchar&lt;/span&gt;(400);&lt;/pre&gt;
&lt;pre style=&quot;border-radius: 4px; border: 1px none rgb(204, 204, 204); box-sizing: border-box; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 855px; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; color: blue;&quot;&gt;DECLARE&lt;/span&gt; @Status tinyint;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;box-sizing: border-box; margin-bottom: 10px;&quot;&gt;
“c:\SetVariables.sql” is where is set my variables. You notice that the SQL variable @Status is set to a SQLCMD variable of the same name “Status”. This allows me to control that from my batch sql file. I am trying to eliminate any hard coded references in my global files.&lt;/div&gt;
&lt;div style=&quot;box-sizing: border-box;&quot;&gt;
&lt;div style=&quot;background-color: #f4f4f4; border-style: none; box-sizing: border-box; color: black; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; overflow: visible; padding: 0px; width: 855px;&quot;&gt;
&lt;pre style=&quot;background-color: white; border-radius: 4px; border: 1px none rgb(204, 204, 204); box-sizing: border-box; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 855px; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; color: blue;&quot;&gt;SET&lt;/span&gt; @Status = $(Status);&lt;/pre&gt;
&lt;pre style=&quot;border-radius: 4px; border: 1px none rgb(204, 204, 204); box-sizing: border-box; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 855px; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; color: blue;&quot;&gt;SET&lt;/span&gt; @AccountingStartDate = (&lt;span style=&quot;box-sizing: border-box; color: blue;&quot;&gt;SELECT&lt;/span&gt; AdventureWorks.dbo.ufnGetAccountingStartDate());&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-radius: 4px; border: 1px none rgb(204, 204, 204); box-sizing: border-box; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 855px; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; color: blue;&quot;&gt;SET&lt;/span&gt; @AccountingEndDate = (&lt;span style=&quot;box-sizing: border-box; color: blue;&quot;&gt;SELECT&lt;/span&gt; AdventureWorks.dbo.ufnGetAccountingEndDate());&lt;/pre&gt;
&lt;pre style=&quot;border-radius: 4px; border: 1px none rgb(204, 204, 204); box-sizing: border-box; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 855px; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; color: blue;&quot;&gt;SET&lt;/span&gt; @DocumentStatusText = (&lt;span style=&quot;box-sizing: border-box; color: blue;&quot;&gt;SELECT&lt;/span&gt; AdventureWorks.dbo.ufnGetDocumentStatusText(@Status));&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;box-sizing: border-box; margin-bottom: 10px;&quot;&gt;
And finally the batch file “c:\SQLBatch.sql”. The first two lines set my include files to variables. This allows for a consistent naming through all my files and allows me to change the files without having to change the batch code. This is good for testing and portability. The next line is where I set the SQLCMD “Status” variable. This variable is then set in the SetVariables.sql file to the TSQL variable @Status that is passed to the function ufnGetDocumentStatusText.&lt;/div&gt;
&lt;div style=&quot;box-sizing: border-box;&quot;&gt;
&lt;div style=&quot;background-color: #f4f4f4; border-style: none; box-sizing: border-box; color: black; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; overflow: visible; padding: 0px; width: 855px;&quot;&gt;
&lt;pre style=&quot;background-color: white; border-radius: 4px; border: 1px none rgb(204, 204, 204); box-sizing: border-box; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 855px; word-break: break-all; word-wrap: break-word;&quot;&gt;:setvar DeclareVariablesScript &quot;c:\DeclareVariables.&lt;span style=&quot;box-sizing: border-box; color: blue;&quot;&gt;sql&lt;/span&gt;&quot;&lt;/pre&gt;
&lt;pre style=&quot;border-radius: 4px; border: 1px none rgb(204, 204, 204); box-sizing: border-box; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 855px; word-break: break-all; word-wrap: break-word;&quot;&gt;:setvar SetVariablesScript &quot;c:\SetVariables.&lt;span style=&quot;box-sizing: border-box; color: blue;&quot;&gt;sql&lt;/span&gt;&quot;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-radius: 4px; border: 1px none rgb(204, 204, 204); box-sizing: border-box; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 855px; word-break: break-all; word-wrap: break-word;&quot;&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style=&quot;border-radius: 4px; border: 1px none rgb(204, 204, 204); box-sizing: border-box; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 855px; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; color: green;&quot;&gt;-- Set Local variable Status (Used in SetVariablesScript)&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-radius: 4px; border: 1px none rgb(204, 204, 204); box-sizing: border-box; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 855px; word-break: break-all; word-wrap: break-word;&quot;&gt;:setvar Status 1&lt;/pre&gt;
&lt;pre style=&quot;border-radius: 4px; border: 1px none rgb(204, 204, 204); box-sizing: border-box; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 855px; word-break: break-all; word-wrap: break-word;&quot;&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-radius: 4px; border: 1px none rgb(204, 204, 204); box-sizing: border-box; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 855px; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; color: green;&quot;&gt;-- Declare Global Script Variables&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;border-radius: 4px; border: 1px none rgb(204, 204, 204); box-sizing: border-box; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 855px; word-break: break-all; word-wrap: break-word;&quot;&gt;:r $(DeclareVariablesScript)&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-radius: 4px; border: 1px none rgb(204, 204, 204); box-sizing: border-box; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 855px; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; color: green;&quot;&gt;-- Set Global Script Variables&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;border-radius: 4px; border: 1px none rgb(204, 204, 204); box-sizing: border-box; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 855px; word-break: break-all; word-wrap: break-word;&quot;&gt;:r $(SetVariablesScript)&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-radius: 4px; border: 1px none rgb(204, 204, 204); box-sizing: border-box; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 855px; word-break: break-all; word-wrap: break-word;&quot;&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style=&quot;border-radius: 4px; border: 1px none rgb(204, 204, 204); box-sizing: border-box; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 855px; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; color: blue;&quot;&gt;SELECT&lt;/span&gt; * &lt;span style=&quot;box-sizing: border-box; color: blue;&quot;&gt;FROM&lt;/span&gt; AdventureWorks.Sales.SalesOrderHeader soh&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-radius: 4px; border: 1px none rgb(204, 204, 204); box-sizing: border-box; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 855px; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; color: blue;&quot;&gt;WHERE&lt;/span&gt; ((soh.OrderDate &amp;gt; = @AccountingStartDate) &lt;span style=&quot;box-sizing: border-box; color: blue;&quot;&gt;AND&lt;/span&gt; (soh.OrderDate &amp;lt;= @AccountingEndDate));&lt;/pre&gt;
&lt;pre style=&quot;border-radius: 4px; border: 1px none rgb(204, 204, 204); box-sizing: border-box; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 855px; word-break: break-all; word-wrap: break-word;&quot;&gt;GO&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;box-sizing: border-box; margin-bottom: 10px;&quot;&gt;
Now all I have to do it execute the file “c:\SQLBatch.sql”. If you are familiar with ASP include files this should be easy to understand.&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://sqlserverfreak.blogspot.com/feeds/1003157260192559855/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sqlserverfreak.blogspot.com/2016/06/sqlcmd-and-power-of-little-r-i-would.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/1003157260192559855'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/1003157260192559855'/><link rel='alternate' type='text/html' href='http://sqlserverfreak.blogspot.com/2016/06/sqlcmd-and-power-of-little-r-i-would.html' title=''/><author><name>SPK</name><uri>http://www.blogger.com/profile/07569889026692963359</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4468522590561210250.post-4756614715776589632</id><published>2015-09-17T23:35:00.000-07:00</published><updated>2015-09-17T23:35:17.449-07:00</updated><title type='text'>How can I switch themes in Visual Studio 2012 ? </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; color: #222222; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 19.5px; margin-bottom: 1em; padding: 0px;&quot;&gt;
In Visual Studio 2012, open the Options dialog (&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;Tools -&amp;gt; Options&lt;/strong&gt;). Under&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;Environment -&amp;gt; General&lt;/strong&gt;, the first setting is &quot;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;Color theme&lt;/strong&gt;.&quot; You can use this to switch between Light and Dark.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; color: #222222; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 19.5px; margin-bottom: 1em; padding: 0px;&quot;&gt;
The shell theme is distinct from the editor theme--you can use any editor fonts and colors settings with either shell theme.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; color: #222222; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 19.5px; margin-bottom: 1em; padding: 0px;&quot;&gt;
&lt;img alt=&quot;O hai!&quot; height=&quot;236&quot; src=&quot;http://i.stack.imgur.com/FXabr.png&quot; style=&quot;border: 0px; margin: 0px; max-width: 630px; padding: 0px;&quot; width=&quot;400&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; color: #222222; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 19.5px; margin-bottom: 1em; padding: 0px;&quot;&gt;
There is also a&amp;nbsp;&lt;a href=&quot;http://visualstudiogallery.msdn.microsoft.com/366ad100-0003-4c9a-81a8-337d4e7ace05&quot; style=&quot;border: 0px; color: #0c65a5; cursor: pointer; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;Color Theme Editor&lt;/a&gt;&amp;nbsp;extension that can be used to create new themes.&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://sqlserverfreak.blogspot.com/feeds/4756614715776589632/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sqlserverfreak.blogspot.com/2015/09/how-can-i-switch-themes-in-visual.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/4756614715776589632'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/4756614715776589632'/><link rel='alternate' type='text/html' href='http://sqlserverfreak.blogspot.com/2015/09/how-can-i-switch-themes-in-visual.html' title='How can I switch themes in Visual Studio 2012 ? '/><author><name>SPK</name><uri>http://www.blogger.com/profile/07569889026692963359</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4468522590561210250.post-6488850558187291382</id><published>2015-03-12T00:08:00.003-07:00</published><updated>2015-03-12T00:08:52.467-07:00</updated><title type='text'>Removing HTTPS binding affects other sites.</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;background-color: #fafafa; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px; text-align: justify;&quot;&gt;You may receive the below error message while removing https binding for domain in IIS.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: #fafafa; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px; text-align: justify;&quot; /&gt;
&lt;div class=&quot;bbcode_container&quot; style=&quot;background-color: #fafafa; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px; margin: 5px 20px 20px; outline: none; padding: 0px; text-align: justify;&quot;&gt;
&lt;pre class=&quot;bbcode_code&quot; style=&quot;background: none repeat-x rgb(242, 246, 248); border: 1px inset; direction: ltr; font-size: 12px; line-height: 12px; overflow: scroll; padding: 6px; text-align: left;&quot;&gt;Removing HTTPS binding may affect the other sites&lt;/pre&gt;
&lt;/div&gt;
&lt;br style=&quot;background-color: #fafafa; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: #fafafa; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px; text-align: justify;&quot;&gt;Solution: If you remove the https binding for the site through IIS then the SSL certificate will also be removed for another domain to which the certificate is assigned.&lt;/span&gt;&lt;br style=&quot;background-color: #fafafa; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px; text-align: justify;&quot; /&gt;&lt;br style=&quot;background-color: #fafafa; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: #fafafa; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px; text-align: justify;&quot;&gt;The only way is to remove the SSL bindings from the applicationhost.config file.&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;background-color: #fafafa; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px; text-align: justify;&quot; /&gt;&lt;br style=&quot;background-color: #fafafa; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: #fafafa; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px; text-align: justify;&quot;&gt;# Login to the server through RDP.&lt;/span&gt;&lt;br style=&quot;background-color: #fafafa; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: #fafafa; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px; text-align: justify;&quot;&gt;# Go to path C:/windows/system32/inetsrv/config&lt;/span&gt;&lt;br style=&quot;background-color: #fafafa; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: #fafafa; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px; text-align: justify;&quot;&gt;# Open the applicationhost.config file&lt;/span&gt;&lt;br style=&quot;background-color: #fafafa; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: #fafafa; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px; text-align: justify;&quot;&gt;# Search for domain SSL binding which you want to remove.&lt;/span&gt;&lt;br style=&quot;background-color: #fafafa; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: #fafafa; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px; text-align: justify;&quot;&gt;# Delete that complete line of the SSL binding and save the file.&lt;/span&gt;&lt;br style=&quot;background-color: #fafafa; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px; text-align: justify;&quot; /&gt;&lt;br style=&quot;background-color: #fafafa; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: #fafafa; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px; text-align: justify;&quot;&gt;You will see that the SSL binding for the domain has been removed without affecting other domains.&lt;/span&gt;&lt;br style=&quot;background-color: #fafafa; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px; text-align: justify;&quot; /&gt;&lt;br style=&quot;background-color: #fafafa; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: #fafafa; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px; text-align: justify;&quot;&gt;Note: Make sure you take the backup of the applicationhost.config file before making changes&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://sqlserverfreak.blogspot.com/feeds/6488850558187291382/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sqlserverfreak.blogspot.com/2015/03/removing-https-binding-affects-other.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/6488850558187291382'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/6488850558187291382'/><link rel='alternate' type='text/html' href='http://sqlserverfreak.blogspot.com/2015/03/removing-https-binding-affects-other.html' title='Removing HTTPS binding affects other sites.'/><author><name>SPK</name><uri>http://www.blogger.com/profile/07569889026692963359</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4468522590561210250.post-6276194289866342842</id><published>2014-11-26T20:50:00.002-08:00</published><updated>2014-11-26T20:50:21.649-08:00</updated><title type='text'>AWS EC2 VPC -  RDS Error: The semaphore timeout period has expired</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;MsoPlainText&quot;&gt;
This issue is caused by TCP offloading on some Windows
EC2 instances which connect to SQL Server DB instances. We need to disable
TCP Offloading on your EC2 Instance(s) and perform a reboot to resolve the
issue.&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;MsoPlainText&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoPlainText&quot;&gt;
The following aligns with Microsoft&#39;s guidance as outlined in the KB
article: &lt;a href=&quot;http://support.microsoft.com/kb/942861&quot;&gt;http://support.microsoft.com/kb/942861&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoPlainText&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoPlainText&quot;&gt;
&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Bring up the &quot;Network Adapters&quot; by opening &quot;ncpa.cpl&quot; (type
at a Run prompt or in the Start Menu&#39;s Search box)&lt;/li&gt;
&lt;li&gt;Right click the &quot;Local Area Connection&quot; and select &quot;Properties&quot;&lt;/li&gt;
&lt;li&gt;Click the &quot;Configure&quot; button&lt;/li&gt;
&lt;li&gt;Select the &quot;Advanced Tab&quot;&lt;/li&gt;
&lt;li&gt;Select the following five &quot;Properties&quot; and set the &quot;Value&quot;
to &quot;Disabled&quot; (See attached screenshot highlights)&lt;/li&gt;
&lt;/ul&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; *
IPv4 Checksum Offload&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; *
Large Receive Offload (IPv4)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; *
Large Send Offload Version 2 (IPv4)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; *
TCP Checksum Offload (IPv4)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; *
UDP Checksum Offload (IPv4)&lt;br /&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Click &quot;OK&quot; to close the dialog box, then close the &quot;Network
Adapters&quot; window&lt;/li&gt;
&lt;li&gt;Run the following script from a command prompt to set global TCP offload
settings:&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; C:\&amp;gt;
netsh int ip set global taskoffload=disabled&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; C:\&amp;gt;
netsh int tcp set global chimney=disabled&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; C:\&amp;gt;
netsh int tcp set global rss=disabled&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; C:\&amp;gt;
netsh int tcp set global netdma=disabled&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;
&lt;div class=&quot;MsoPlainText&quot;&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoPlainText&quot;&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoPlainText&quot;&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoPlainText&quot;&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoPlainText&quot;&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoPlainText&quot;&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoPlainText&quot;&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoPlainText&quot;&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoPlainText&quot;&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoPlainText&quot;&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoPlainText&quot;&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoPlainText&quot;&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoPlainText&quot;&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoPlainText&quot;&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoPlainText&quot;&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://sqlserverfreak.blogspot.com/feeds/6276194289866342842/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sqlserverfreak.blogspot.com/2014/11/aws-ec2-vpc-rds-error-semaphore-timeout.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/6276194289866342842'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/6276194289866342842'/><link rel='alternate' type='text/html' href='http://sqlserverfreak.blogspot.com/2014/11/aws-ec2-vpc-rds-error-semaphore-timeout.html' title='AWS EC2 VPC -  RDS Error: The semaphore timeout period has expired'/><author><name>SPK</name><uri>http://www.blogger.com/profile/07569889026692963359</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4468522590561210250.post-2964192345383975175</id><published>2014-11-26T20:44:00.002-08:00</published><updated>2014-11-26T20:44:52.565-08:00</updated><title type='text'>Alternative to .NET Reflector</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
For those of you who miss .NET Reflector (since Redgate took
down the free version in 2011), there is a pretty good open source alternative:
&lt;a href=&quot;http://ilspy.net/&quot;&gt;ILSpy&lt;/a&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
The tool is designed around the original Roy Osherove’s .NET
Reflector and supports all its major features including intermediate language
disassembly, reflection (browsing), decompilation to C#.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
It is a pretty decent IL
decompiler.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://sqlserverfreak.blogspot.com/feeds/2964192345383975175/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sqlserverfreak.blogspot.com/2014/11/alternative-to-net-reflector.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/2964192345383975175'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/2964192345383975175'/><link rel='alternate' type='text/html' href='http://sqlserverfreak.blogspot.com/2014/11/alternative-to-net-reflector.html' title='Alternative to .NET Reflector'/><author><name>SPK</name><uri>http://www.blogger.com/profile/07569889026692963359</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4468522590561210250.post-3837261349303092201</id><published>2014-09-16T21:19:00.001-07:00</published><updated>2014-09-16T21:19:52.574-07:00</updated><title type='text'>How to backup Amazon RDS MS SQL Server database instance and restore locally</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div style=&quot;background: rgb(255, 255, 255); border: 0px; clear: both; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 17.8048000335693px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;&quot;&gt;
We can&#39;t currently create a .bak file out of amazon rds. The way I handle this is to use the azure migration wizard which just happens to also work with amazon rds.&lt;/div&gt;
&lt;div style=&quot;background: rgb(255, 255, 255); border: 0px; clear: both; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 17.8048000335693px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;&quot;&gt;
I spin up a EC2 instance with SQL Server and the migration wizard installed. I then use the migration tool to copy the RDS database to the ec2 instance.&lt;/div&gt;
&lt;div style=&quot;background: rgb(255, 255, 255); border: 0px; clear: both; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 17.8048000335693px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;&quot;&gt;
Once that is done you can create a .bak file from the SQL Server running on the EC2 instance. its a pain but it works. if you have the bandwidth or your database is small you may be able to use the migration tool directly on your target machine.&lt;/div&gt;
&lt;div style=&quot;background: rgb(255, 255, 255); border: 0px; clear: both; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 17.8048000335693px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;a href=&quot;http://sqlazuremw.codeplex.com/&quot; rel=&quot;nofollow&quot; style=&quot;background: transparent; border: 0px; color: #4a6b82; cursor: pointer; margin: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;&quot;&gt;http://sqlazuremw.codeplex.com&lt;/a&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://sqlserverfreak.blogspot.com/feeds/3837261349303092201/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sqlserverfreak.blogspot.com/2014/09/how-to-backup-amazon-rds-ms-sql-server.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/3837261349303092201'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/3837261349303092201'/><link rel='alternate' type='text/html' href='http://sqlserverfreak.blogspot.com/2014/09/how-to-backup-amazon-rds-ms-sql-server.html' title='How to backup Amazon RDS MS SQL Server database instance and restore locally'/><author><name>SPK</name><uri>http://www.blogger.com/profile/07569889026692963359</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4468522590561210250.post-6952608864748312813</id><published>2014-02-13T22:42:00.002-08:00</published><updated>2014-02-13T22:42:18.499-08:00</updated><title type='text'>&quot;Launchy&quot;</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
I don’t know if this product is widely known here but it
came up in conversation yesterday so I thought I’d share. In my opinion, it’s
one of the most useful tools around…and it’s free. Spend a bit of time with it
and see for yourselves.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;a href=&quot;http://www.launchy.net/&quot;&gt;http://www.launchy.net/&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://sqlserverfreak.blogspot.com/feeds/6952608864748312813/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sqlserverfreak.blogspot.com/2014/02/launchy.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/6952608864748312813'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4468522590561210250/posts/default/6952608864748312813'/><link rel='alternate' type='text/html' href='http://sqlserverfreak.blogspot.com/2014/02/launchy.html' title='&quot;Launchy&quot;'/><author><name>SPK</name><uri>http://www.blogger.com/profile/07569889026692963359</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>