<?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-2328222207349876984</id><updated>2026-02-25T15:10:07.200-08:00</updated><category term="presentation"/><category term="usergroup"/><category term="tsql"/><category term="sql"/><category term="dmv"/><category term="sqlsaturday"/><category term="batonrouge"/><category term="downloads"/><category term="sqlsatbr"/><category term="sqlsat"/><category term="index"/><category term="sqlpass"/><category term="slidedeck"/><category term="ethics"/><category term="security"/><category term="performance"/><category term="powershell"/><category term="actualemails"/><category term="houstontechfest"/><category term="ssis"/><category term="azure"/><category term="certification"/><category term="ssms"/><category term=".net"/><category term="datatypes"/><category term="errormessage"/><category term="script"/><category term="sqlsathouston"/><category term="ssrs"/><category term="brssug"/><category term="microsoft"/><category term="visualstudio"/><category term="activ8conf"/><category term="availabilitygroups"/><category term="backup"/><category term="career"/><category term="consulting"/><category term="excel"/><category term="sharepoint"/><category term="disasterrecovery"/><category term="exams"/><category term="foreignkey"/><category term="groupby"/><category term="humor"/><category term="machinelearning"/><category term="mvp"/><category term="powerbi"/><category term="replication"/><category term="sql2019"/><category term="sqlbook"/><category term="sqlsat324"/><category term="sqlsat328"/><category term="sqlsat64"/><category term="sqlsatpensacola"/><category term="ssas"/><category term="time"/><category term="transactionlog"/><category term="twitter"/><category term="windows"/><category term=".net3.5"/><category term="2008"/><category term="AI"/><category term="AlwaysOn"/><category term="Nonsql"/><category term="access"/><category term="architecture"/><category term="cdc"/><category term="columnstore"/><category term="davc"/><category term="float"/><category term="github"/><category term="guids"/><category term="heap"/><category term="htechfest"/><category term="information_schema"/><category term="install"/><category term="instance"/><category term="int"/><category term="join"/><category term="lafayette"/><category term="linq"/><category term="nolock"/><category term="normalization"/><category term="odbc"/><category term="sadodn"/><category term="sql2012"/><category term="sql2014"/><category term="sql2016"/><category term="sqlsat491"/><category term="sqlsat560"/><category term="sqlsatdallas"/><category term="ssdt"/><category term="tfs"/><category term="tls"/><category term="training"/><category term="visio"/><category term="xevents"/><category term="#AlwaysOn"/><category term="Ifi"/><category term="aitp"/><category term="ansi_warnings"/><category term="autogrowth"/><category term="azuredatastudio"/><category term="azuresqldb"/><category term="bigdataclusters"/><category term="blogging"/><category term="cerd"/><category term="compatibility"/><category term="cpu"/><category term="cube"/><category term="dacpac"/><category term="dataanz"/><category term="datageeks"/><category term="datasaturday"/><category term="dataweekender"/><category term="date"/><category term="datetime2"/><category term="datetimeoffset"/><category term="deadlock"/><category term="dedup"/><category term="defaultconstraint"/><category term="defaulttrace"/><category term="defrag"/><category term="dependencies"/><category term="diagram"/><category term="dta"/><category term="dts"/><category term="erd"/><category term="filestream"/><category term="firewall"/><category term="google"/><category term="https"/><category term="idera"/><category term="iis"/><category term="improvingedge"/><category term="interview"/><category term="isolationlevel"/><category term="jambalaya"/><category term="lambda"/><category term="math"/><category term="msdb"/><category term="msoledbsql"/><category term="multithreading"/><category term="musiccitytech"/><category term="oledb"/><category term="oracle"/><category term="over"/><category term="partition"/><category term="passmarathon"/><category term="perd"/><category term="powerpivot"/><category term="powerquery"/><category term="procrastiblogging"/><category term="r"/><category term="readuncommitted"/><category term="resourcegovernor"/><category term="routines"/><category term="schemabinding"/><category term="schemacompare"/><category term="servername"/><category term="servicebroker"/><category term="size"/><category term="snac"/><category term="snapshotisolation"/><category term="sp3"/><category term="sp_help"/><category term="spsevents"/><category term="sql 2008"/><category term="sql2000"/><category term="sql2008r2sp1"/><category term="sql; sqlbook;"/><category term="sqlagent"/><category term="sqlbi"/><category term="sqldenali"/><category term="sqlfamily"/><category term="sqlncli"/><category term="sqlncli11"/><category term="sqlsat sqlsatoregon"/><category term="sqlsat234"/><category term="sqlsat255"/><category term="sqlsat28"/><category term="sqlsat423"/><category term="sqlsat514"/><category term="sqlsat515"/><category term="sqlsat593"/><category term="sqlsatauckland"/><category term="sqlsatbrbi"/><category term="sqlsatdallas sqlsat"/><category term="sqlsatmemphis"/><category term="ssis script"/><category term="ssisscaleout"/><category term="students"/><category term="tcp"/><category term="tds"/><category term="teched"/><category term="telnet"/><category term="threads"/><category term="tinyint"/><category term="try_convert"/><category term="vscode"/><category term="winmerge"/><category term="xml"/><category term="xmla"/><title type='text'>SQL Tact</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='https://www.sqltact.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/2328222207349876984/posts/default?max-results=5'/><link rel='alternate' type='text/html' href='https://www.sqltact.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='https://www.blogger.com/feeds/2328222207349876984/posts/default?start-index=6&amp;max-results=5'/><author><name>Unknown</name><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>325</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>5</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2328222207349876984.post-7856239038142784665</id><published>2025-06-05T16:55:00.000-07:00</published><updated>2025-06-05T16:56:12.041-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="github"/><category scheme="http://www.blogger.com/atom/ns#" term="microsoft"/><category scheme="http://www.blogger.com/atom/ns#" term="mvp"/><title type='text'>Easily query your GitHub Contribution activity </title><content type='html'>For a variety of reasons, including your Microsoft MVP activity reports, you might want to summarize your GitHub activity across multiple repos.&amp;nbsp;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;For contributors to Microsoft open-source docs on GitHub, all your contributions would end up in the MicrosoftDocs organization. Microsoft owns thousands of open-source repositories across many organizations, if you&#39;ve contributed to others, variations on this same query work.&lt;br /&gt;&lt;br /&gt;Absent a dashboard making this easier (keep an eye on this), here are some GitHub queries helpful to you.&lt;br /&gt;&lt;br /&gt;You can find all merged PRs in public MicrosoftDocs org repositories using this search syntax on &lt;a href=&quot;https://www.GitHub.com&quot;&gt;GitHub.com&lt;/a&gt;&#39;s main search bar: &lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;is:pr author:&amp;lt;your GitHub username&amp;gt; is:public&amp;nbsp;org:microsoftdocs&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;merged:&amp;gt;=YYYY-MM-DD&lt;/span&gt;&lt;/p&gt;For example:&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;is:pr author:williamadba is:public&amp;nbsp;org:microsoftdocs&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;merged:&amp;gt;=2019-01-01&lt;/span&gt;&lt;/p&gt;Which results in the URL:&lt;div&gt;&lt;br /&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;a href=&quot;https://github.com/search?q=is%3Apr+author%3Awilliamadba+is%3Apublic+org%3Amicrosoftdocs+merged%3A%3E%3D2019-01-01&amp;amp;type=pullrequests&quot;&gt;https://github.com/search?q=is%3Apr+author%3Awilliamadba+is%3Apublic+org%3Amicrosoftdocs+merged%3A%3E%3D2019-01-01&amp;amp;type=pullrequests&lt;/a&gt;&lt;/span&gt;&lt;p&gt;You can also use the GitHub API for programmatic access:&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;a href=&quot;https://api.github.com/search/issues?q=is%3Apr+author%3Awilliamadba+org%3Amicrosoftdocs+is%3Apublic+created%3A%3E%3D2019-04-01&amp;amp;type=pullrequests&quot;&gt;https://api.github.com/search/issues?q=is%3Apr+author%3Awilliamadba+org%3Amicrosoftdocs+is%3Apublic+created%3A%3E%3D2019-04-01&amp;amp;type=pullrequests&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;div&gt;&lt;div&gt;Feel free to comment if you have other preferred methods of tracking your Docs contributions on GitHub.com.&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.sqltact.com/feeds/7856239038142784665/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/2328222207349876984/7856239038142784665?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/2328222207349876984/posts/default/7856239038142784665'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/2328222207349876984/posts/default/7856239038142784665'/><link rel='alternate' type='text/html' href='https://www.sqltact.com/2025/06/easily-query-your-github-contribution.html' title='Easily query your GitHub Contribution activity '/><author><name>Unknown</name><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-2328222207349876984.post-586746000073237601</id><published>2024-05-03T15:46:00.000-07:00</published><updated>2024-05-03T15:46:46.814-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="datetimeoffset"/><category scheme="http://www.blogger.com/atom/ns#" term="sql2016"/><category scheme="http://www.blogger.com/atom/ns#" term="time"/><title type='text'>Migrate datetime data to datetimeoffset with AT TIME ZONE</title><content type='html'>&lt;p&gt;I recently reviewed, worked on, and added a similar example to the &lt;a href=&quot;https://learn.microsoft.com/en-us/sql/t-sql/data-types/datetimeoffset-transact-sql&quot; target=&quot;_blank&quot;&gt;DATETIMEOFFSET Microsoft Learn Docs article&lt;/a&gt; at the recommendation of my colleague &lt;a href=&quot;https://bornsql.ca/blog/&quot; target=&quot;_blank&quot;&gt;Randolph West&lt;/a&gt;, who guessed (accurately) I would enjoy such a task. It was a nice pre-Build diversion.&amp;nbsp;&lt;/p&gt;&lt;p&gt;This topic is one that I have &lt;a href=&quot;https://www.sqltact.com/2017/09/twilight-timezone-date-and-time.html&quot; target=&quot;_blank&quot;&gt;co-presented on&lt;/a&gt; in the past and hounded project capstone review presentations about. &lt;b&gt;If you&#39;re not storing time zone offset in your date/time data, you&#39;re setting yourself up for future pain. &lt;/b&gt;That future pain is not what this blog post is about.&lt;/p&gt;&lt;p&gt;One of the big complications of converting date/time data without time zone info is Daylight Savings Time. There are various versions of time zone weirdness around the globe, but in most of the United States, we &lt;i&gt;fall backwards &lt;/i&gt;and &lt;i&gt;spring forwards &lt;/i&gt;by one hour each year. (This is why the state of Indiana has its own time zone, my dear friend and editor Drew Lanclos noted.)&lt;/p&gt;&lt;p&gt;Simply subtracting the &lt;i&gt;current &lt;/i&gt;offset hours to arrive at Eastern/Central/Mountain/Pacific Standard Time will be incorrect for half of each year. This is most invisibly painful when applied to historic data.&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;How NOT to convert data to datetimeoffset&lt;/h3&gt;&lt;div style=&quot;background-color: #fffffe; color: #212121; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; line-height: 16px; white-space: pre;&quot;&gt;&lt;div&gt;&lt;span style=&quot;color: blue;&quot;&gt;DECLARE&lt;/span&gt; @TimeZone &lt;span style=&quot;color: blue;&quot;&gt;VARCHAR&lt;/span&gt;(&lt;span style=&quot;color: #09885a;&quot;&gt;50&lt;/span&gt;);&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: blue;&quot;&gt;SELECT&lt;/span&gt; @TimeZone &lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt; [name]&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt; sys.time_zone_info&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: blue;&quot;&gt;WHERE&lt;/span&gt; [name] &lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #a31515;&quot;&gt;&#39;Pacific Standard Time&#39;&lt;/span&gt;;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;--Pretend that audit_created below is a UTC date that needs 
--   to be converted to the local timezone for display.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;--If executed between Nov-March, &#39;Bad Strategy&#39; below is wrong for historical dates between March-Nov. &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;--Between March-Nov, &#39;Bad Strategy&#39; below is wrong for historical dates between Nov-March. &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: blue;&quot;&gt;SELECT&lt;/span&gt; &lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; UTCDate &lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt; audit_created &amp;nbsp;&lt;/div&gt;&lt;div&gt;, &amp;nbsp; BadStrategy &lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #795e26;&quot;&gt;DATEADD&lt;/span&gt;(&lt;span style=&quot;color: blue;&quot;&gt;second&lt;/span&gt;, &lt;span style=&quot;color: #795e26;&quot;&gt;DATEDIFF&lt;/span&gt;(&lt;span style=&quot;color: blue;&quot;&gt;second&lt;/span&gt;, &lt;span style=&quot;color: #795e26;&quot;&gt;GETUTCDATE&lt;/span&gt;(), &lt;span style=&quot;color: #795e26;&quot;&gt;GETDATE&lt;/span&gt;()), audit_created ) &lt;span style=&quot;color: green;&quot;&gt;--Don&#39;t use!&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt; #audit_created&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: blue;&quot;&gt;GO&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h3&gt;How to convert data to datetimeoffset&lt;/h3&gt;&lt;div&gt;Use the &lt;a href=&quot;https://learn.microsoft.com/sql/t-sql/queries/at-time-zone-transact-sql?view=sql-server-ver16&quot; target=&quot;_blank&quot;&gt;AT TIME ZONE&lt;/a&gt; syntax, introduced in SQL Server 2016.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;line-height: 16px;&quot;&gt;&lt;div style=&quot;background-color: #fffffe; color: #212121; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;DECLARE&lt;/span&gt; @TimeZone &lt;span style=&quot;color: blue;&quot;&gt;VARCHAR&lt;/span&gt;(&lt;span style=&quot;color: #09885a;&quot;&gt;50&lt;/span&gt;);&lt;/div&gt;&lt;br /&gt;&lt;div style=&quot;background-color: #fffffe; color: #212121; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;SELECT&lt;/span&gt; @TimeZone &lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt; [name]&lt;/div&gt;&lt;div style=&quot;background-color: #fffffe; color: #212121; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt; sys.time_zone_info&lt;/div&gt;&lt;div style=&quot;background-color: #fffffe; color: #212121; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;WHERE&lt;/span&gt; [name] &lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #a31515;&quot;&gt;&#39;Pacific Standard Time&#39;&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;background-color: #fffffe; color: #212121; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;&lt;span style=&quot;color: green;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #fffffe; color: #212121; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;&lt;span style=&quot;color: green;&quot;&gt;--Pretend that audit_created below is a UTC date that needs to be converted to the local timezone for display.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #fffffe; color: #212121; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;SELECT&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;background-color: #fffffe; color: #212121; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;&amp;nbsp; &amp;nbsp; UTCDate &lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt; audit_created &amp;nbsp;&lt;/div&gt;&lt;div style=&quot;background-color: #fffffe; color: #212121; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;, &amp;nbsp; CorrectStrategy &lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt; audit_created &amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;AT&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;TIME&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;ZONE&lt;/span&gt; &lt;span style=&quot;color: #a31515;&quot;&gt;&#39;UTC&#39;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;AT&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;TIME&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;ZONE&lt;/span&gt; @TimeZone &lt;span style=&quot;color: green;&quot;&gt;--SQL 2016+ only&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #fffffe; color: #212121; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt; #audit_created&lt;/div&gt;&lt;div style=&quot;background-color: #fffffe; color: #212121; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;GO&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #fffffe; color: #212121; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;In the SELECT statement, the AT TIME ZONE syntax first adds UTC time zone offset to the existing audit_created column data, then converts the data from UTC to Pacific Standard Time, correctly adjusting the historical data for each prior Daylight Savings Time range in the United States.&lt;br /&gt;&lt;br /&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;A longer sample lab for you to try it yourself&lt;/h3&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 16px;&quot;&gt;&lt;div style=&quot;background-color: #fffffe; line-height: 16px;&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;color: #212121; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;DROP&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;TABLE&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;IF&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;EXISTS&lt;/span&gt; dbo.audit&lt;/div&gt;&lt;div style=&quot;color: #212121; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;GO&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #212121; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;CREATE&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;TABLE&lt;/span&gt; &lt;span style=&quot;color: #795e26;&quot;&gt;dbo&lt;/span&gt;.&lt;span style=&quot;color: blue;&quot;&gt;audit&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #212121; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;(audit_created &lt;span style=&quot;color: blue;&quot;&gt;datetime2&lt;/span&gt;(&lt;span style=&quot;color: #09885a;&quot;&gt;0&lt;/span&gt;) &lt;span style=&quot;color: blue;&quot;&gt;primary key&lt;/span&gt;) &lt;/div&gt;&lt;div style=&quot;color: #212121; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;GO&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style=&quot;color: #212121; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;INSERT INTO&lt;/span&gt; dbo.audit (audit_created) &lt;span style=&quot;color: blue;&quot;&gt;VALUES&lt;/span&gt; (&lt;span style=&quot;color: #a31515;&quot;&gt;&#39;1/1/2024 12:00:00&#39;&lt;/span&gt;);&lt;/div&gt;&lt;div style=&quot;color: #212121; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;INSERT INTO&lt;/span&gt; dbo.audit (audit_created) &lt;span style=&quot;color: blue;&quot;&gt;VALUES&lt;/span&gt; (&lt;span style=&quot;color: #a31515;&quot;&gt;&#39;5/1/2024 12:00:00&#39;&lt;/span&gt;);&lt;/div&gt;&lt;div style=&quot;color: #212121; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;INSERT INTO&lt;/span&gt; dbo.audit (audit_created) &lt;span style=&quot;color: blue;&quot;&gt;VALUES&lt;/span&gt; (&lt;span style=&quot;color: #a31515;&quot;&gt;&#39;12/1/2024 12:00:00&#39;&lt;/span&gt;);&lt;/div&gt;&lt;div style=&quot;color: #212121; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;GO&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #212121; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;ALTER&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;TABLE&lt;/span&gt; dbo.audit&lt;/div&gt;&lt;div style=&quot;color: #212121; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;ADD&lt;/span&gt; audit_created_offset &lt;span style=&quot;color: blue;&quot;&gt;datetimeoffset&lt;/span&gt;(&lt;span style=&quot;color: #09885a;&quot;&gt;0&lt;/span&gt;) &lt;span style=&quot;color: blue;&quot;&gt;NULL&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;color: #212121; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;GO&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style=&quot;color: #212121; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;DECLARE&lt;/span&gt; @TimeZone &lt;span style=&quot;color: blue;&quot;&gt;VARCHAR&lt;/span&gt;(&lt;span style=&quot;color: #09885a;&quot;&gt;50&lt;/span&gt;);&lt;/div&gt;&lt;br /&gt;&lt;div style=&quot;color: #212121; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;SELECT&lt;/span&gt; @TimeZone &lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt; [name]&lt;/div&gt;&lt;div style=&quot;color: #212121; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt; sys.time_zone_info&lt;/div&gt;&lt;div style=&quot;color: #212121; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;WHERE&lt;/span&gt; [name] &lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #a31515;&quot;&gt;&#39;Pacific Standard Time&#39;&lt;/span&gt;;&lt;/div&gt;&lt;br /&gt;&lt;div style=&quot;color: #212121; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;UPDATE&lt;/span&gt; dbo.audit &lt;/div&gt;&lt;div style=&quot;color: #212121; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;SET&lt;/span&gt; audit_created_offset &lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt; audit_created &lt;span style=&quot;color: blue;&quot;&gt;AT&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;TIME&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;ZONE&lt;/span&gt; &lt;span style=&quot;color: #a31515;&quot;&gt;&#39;UTC&#39;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;AT&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;TIME&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;ZONE&lt;/span&gt; @TimeZone &lt;/div&gt;&lt;div style=&quot;color: #212121; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;WHERE&lt;/span&gt; audit_created_offset &lt;span style=&quot;color: blue;&quot;&gt;is&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;NULL&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #212121; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;GO&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #212121; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;SELECT&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt; dbo.audit&lt;/div&gt;&lt;div style=&quot;color: #212121; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;color: #212121; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #212121; font-family: Consolas, Courier New, monospace;&quot;&gt;&lt;span style=&quot;font-size: 12px; white-space: pre;&quot;&gt;audit_created	audit_created_offset
2024-01-01 12:00:00	2024-01-01 04:00:00 -08:00
2024-05-01 12:00:00	2024-05-01 05:00:00 -07:00
2024-12-01 12:00:00	2024-12-01 04:00:00 -08:00&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Note how the January and December dates were shifted to UTC -08:00, but the May date was shifted to UTC -07:00.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;Pre-2016 lab&lt;/h3&gt;&lt;div&gt;Pre-2016 was infinitely more pleasant than the present day in many ways. Time zone conversion is not one of them.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Trying to do this while working in a version of SQL Server prior to 2016? My condolences, but here&#39;s the solution I worked out a five years ago when I was in the same situation, and could not use AT TIME ZONE.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;color: #212121; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; line-height: 16px; white-space: pre;&quot;&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;--This lab demonstrates a common antipattern for converting UTC to the local timezone.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;--Will work &amp;lt;SQL 2016. Optional code at end to uncomment if SQL 2016+&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;--Create the DST population table in comment below at bottom. This could be useful for your apps pre-SQL2016.&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: blue;&quot;&gt;declare&lt;/span&gt; @audit_created &lt;span style=&quot;color: blue;&quot;&gt;table&lt;/span&gt; &lt;/div&gt;&lt;div&gt;(audit_created &lt;span style=&quot;color: blue;&quot;&gt;datetime2&lt;/span&gt;(&lt;span style=&quot;color: #09885a;&quot;&gt;0&lt;/span&gt;))&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: blue;&quot;&gt;insert into&lt;/span&gt; @audit_created (audit_created) &lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: blue;&quot;&gt;values&lt;/span&gt; &lt;/div&gt;&lt;div&gt;&amp;nbsp;(&lt;span style=&quot;color: #a31515;&quot;&gt;&#39;3/12/2017 03:00&#39;&lt;/span&gt;)&lt;/div&gt;&lt;div&gt;,(&lt;span style=&quot;color: #a31515;&quot;&gt;&#39;3/12/2017 04:00&#39;&lt;/span&gt;)&lt;/div&gt;&lt;div&gt;,(&lt;span style=&quot;color: #a31515;&quot;&gt;&#39;3/12/2017 05:00&#39;&lt;/span&gt;) &lt;span style=&quot;color: green;&quot;&gt;--This will be wrong in the the Incorrect pre2016 method if we are currently in DST (March-Nov)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;,(&lt;span style=&quot;color: #a31515;&quot;&gt;&#39;3/12/2017 06:00&#39;&lt;/span&gt;)&lt;/div&gt;&lt;div&gt;,(&lt;span style=&quot;color: #a31515;&quot;&gt;&#39;3/12/2017 07:00&#39;&lt;/span&gt;)&lt;/div&gt;&lt;div&gt;,(&lt;span style=&quot;color: #a31515;&quot;&gt;&#39;3/12/2017 08:00&#39;&lt;/span&gt;)&lt;/div&gt;&lt;div&gt;,(&lt;span style=&quot;color: #a31515;&quot;&gt;&#39;3/12/2017 09:00&#39;&lt;/span&gt;)&lt;/div&gt;&lt;div&gt;,(&lt;span style=&quot;color: #a31515;&quot;&gt;&#39;11/5/2017 03:00&#39;&lt;/span&gt;)&lt;/div&gt;&lt;div&gt;,(&lt;span style=&quot;color: #a31515;&quot;&gt;&#39;11/5/2017 04:00&#39;&lt;/span&gt;)&lt;/div&gt;&lt;div&gt;,(&lt;span style=&quot;color: #a31515;&quot;&gt;&#39;11/5/2017 05:00&#39;&lt;/span&gt;) &lt;span style=&quot;color: green;&quot;&gt;--This will be wrong in the the Incorrect pre2016 method if we are currently not in DST (Nov-March)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;,(&lt;span style=&quot;color: #a31515;&quot;&gt;&#39;11/5/2017 06:00&#39;&lt;/span&gt;)&lt;/div&gt;&lt;div&gt;,(&lt;span style=&quot;color: #a31515;&quot;&gt;&#39;11/5/2017 07:00&#39;&lt;/span&gt;)&lt;/div&gt;&lt;div&gt;,(&lt;span style=&quot;color: #a31515;&quot;&gt;&#39;11/5/2017 08:00&#39;&lt;/span&gt;)&lt;/div&gt;&lt;div&gt;,(&lt;span style=&quot;color: #a31515;&quot;&gt;&#39;11/5/2017 09:00&#39;&lt;/span&gt;)&lt;/div&gt;&lt;div&gt;,(&lt;span style=&quot;color: #a31515;&quot;&gt;&#39;1/1/2017 05:00&#39;&lt;/span&gt;) &lt;span style=&quot;color: green;&quot;&gt;--One of these two rows will be wrong for Central US Time in the Incorrect pre2016 method. It&#39;ll be the one that doesn&#39;t match our CURRENT DST setting.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;,(&lt;span style=&quot;color: #a31515;&quot;&gt;&#39;6/1/2017 05:00&#39;&lt;/span&gt;) &lt;span style=&quot;color: green;&quot;&gt;--One of these two rows will be wrong for Central US Time in the Incorrect pre2016 method. It&#39;ll be the one that doesn&#39;t match our CURRENT DST setting.&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: blue;&quot;&gt;select&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; audit_created &amp;nbsp; &lt;/div&gt;&lt;div&gt;, &amp;nbsp; audit_created_actually_at_UTC &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt; &amp;nbsp; &lt;span style=&quot;color: #795e26;&quot;&gt;TODATETIMEOFFSET&lt;/span&gt;(audit_created, &lt;span style=&quot;color: #09885a;&quot;&gt;0&lt;/span&gt;)&lt;/div&gt;&lt;div&gt;, &amp;nbsp; Incorrect_pre2016_method_Central_time &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt; &amp;nbsp; &lt;span style=&quot;color: #795e26;&quot;&gt;DATEADD&lt;/span&gt;(&lt;span style=&quot;color: blue;&quot;&gt;second&lt;/span&gt;, &lt;span style=&quot;color: #795e26;&quot;&gt;DATEDIFF&lt;/span&gt;(&lt;span style=&quot;color: blue;&quot;&gt;second&lt;/span&gt;, &lt;span style=&quot;color: #795e26;&quot;&gt;GETUTCDATE&lt;/span&gt;(), &lt;span style=&quot;color: #795e26;&quot;&gt;GETDATE&lt;/span&gt;()), audit_created )&lt;/div&gt;&lt;div&gt;, &amp;nbsp; Incorrect_pre2016_method_Central_time_date &amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt; &amp;nbsp; &lt;span style=&quot;color: #795e26;&quot;&gt;CONVERT&lt;/span&gt;(&lt;span style=&quot;color: blue;&quot;&gt;date&lt;/span&gt;, &lt;span style=&quot;color: #795e26;&quot;&gt;DATEADD&lt;/span&gt;(&lt;span style=&quot;color: blue;&quot;&gt;second&lt;/span&gt;, &lt;span style=&quot;color: #795e26;&quot;&gt;DATEDIFF&lt;/span&gt;(&lt;span style=&quot;color: blue;&quot;&gt;second&lt;/span&gt;, &lt;span style=&quot;color: #795e26;&quot;&gt;GETUTCDATE&lt;/span&gt;(), &lt;span style=&quot;color: #795e26;&quot;&gt;GETDATE&lt;/span&gt;()), audit_created ))&lt;/div&gt;&lt;div&gt;, &amp;nbsp; Correct_pre2016_method_Central_time &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt; &amp;nbsp; &lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #795e26;&quot;&gt;SWITCHOFFSET&lt;/span&gt;(&lt;span style=&quot;color: #795e26;&quot;&gt;TODATETIMEOFFSET&lt;/span&gt;(audit_created, &lt;span style=&quot;color: #09885a;&quot;&gt;0&lt;/span&gt;), &amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;CASE&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;WHEN&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;EXISTS&lt;/span&gt; (&lt;span style=&quot;color: blue;&quot;&gt;select&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;from&lt;/span&gt; dbo.DSTDates &lt;span style=&quot;color: blue;&quot;&gt;where&lt;/span&gt; BeginDate&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;=&lt;/span&gt;&lt;span style=&quot;color: #795e26;&quot;&gt;TODATETIMEOFFSET&lt;/span&gt;(audit_created, &lt;span style=&quot;color: #09885a;&quot;&gt;0&lt;/span&gt;) &lt;span style=&quot;color: blue;&quot;&gt;and&lt;/span&gt; EndDate&lt;span style=&quot;color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #795e26;&quot;&gt;TODATETIMEOFFSET&lt;/span&gt;(audit_created, &lt;span style=&quot;color: #09885a;&quot;&gt;0&lt;/span&gt;)) &lt;/div&gt;&lt;div&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; &lt;span style=&quot;color: blue;&quot;&gt;THEN&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #09885a;&quot;&gt;300&lt;/span&gt; &lt;span style=&quot;color: green;&quot;&gt;-- -5:00, CDT&lt;/span&gt;&lt;/div&gt;&lt;div&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; &lt;span style=&quot;color: blue;&quot;&gt;ELSE&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #09885a;&quot;&gt;360&lt;/span&gt; &lt;span style=&quot;color: green;&quot;&gt;-- -6:00, CST &lt;/span&gt;&lt;/div&gt;&lt;div&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; &lt;span style=&quot;color: blue;&quot;&gt;END&lt;/span&gt;) &lt;/div&gt;&lt;div&gt;, &amp;nbsp; Correct_pre2016_method_Central_time_date &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt; &amp;nbsp; &lt;span style=&quot;color: #795e26;&quot;&gt;CONVERT&lt;/span&gt;(&lt;span style=&quot;color: blue;&quot;&gt;DATE&lt;/span&gt;, &lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #795e26;&quot;&gt;SWITCHOFFSET&lt;/span&gt;(&lt;span style=&quot;color: #795e26;&quot;&gt;TODATETIMEOFFSET&lt;/span&gt;(audit_created, &lt;span style=&quot;color: #09885a;&quot;&gt;0&lt;/span&gt;), &amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;CASE&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;WHEN&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;EXISTS&lt;/span&gt; (&lt;span style=&quot;color: blue;&quot;&gt;select&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;from&lt;/span&gt; dbo.DSTDates &lt;span style=&quot;color: blue;&quot;&gt;where&lt;/span&gt; BeginDate&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;=&lt;/span&gt;&lt;span style=&quot;color: #795e26;&quot;&gt;TODATETIMEOFFSET&lt;/span&gt;(audit_created, &lt;span style=&quot;color: #09885a;&quot;&gt;0&lt;/span&gt;) &lt;span style=&quot;color: blue;&quot;&gt;and&lt;/span&gt; EndDate&lt;span style=&quot;color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #795e26;&quot;&gt;TODATETIMEOFFSET&lt;/span&gt;(audit_created, &lt;span style=&quot;color: #09885a;&quot;&gt;0&lt;/span&gt;)) &lt;/div&gt;&lt;div&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; &lt;span style=&quot;color: blue;&quot;&gt;THEN&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #09885a;&quot;&gt;300&lt;/span&gt; &lt;span style=&quot;color: green;&quot;&gt;-- -5:00, CDT&lt;/span&gt;&lt;/div&gt;&lt;div&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; &lt;span style=&quot;color: blue;&quot;&gt;ELSE&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #09885a;&quot;&gt;360&lt;/span&gt; &lt;span style=&quot;color: green;&quot;&gt;-- -6:00, CST &lt;/span&gt;&lt;/div&gt;&lt;div&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; &lt;span style=&quot;color: blue;&quot;&gt;END&lt;/span&gt;) &lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; )&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;--Uncomment the following two rows for the right way to do this in SQL 2016+&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;--, &amp;nbsp; &amp;nbsp;Correct_2016_method &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= &amp;nbsp; audit_created &amp;nbsp;AT TIME ZONE &#39;UTC&#39; AT TIME ZONE &#39;Central Standard Time&#39;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;--, &amp;nbsp; &amp;nbsp;Correct_2016_method__date &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= &amp;nbsp; convert(date, &amp;nbsp;(audit_created AT TIME ZONE &#39;UTC&#39; &amp;nbsp;AT TIME ZONE &#39;Central Standard Time&#39;))&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: blue;&quot;&gt;from&lt;/span&gt; @audit_created &lt;span style=&quot;color: blue;&quot;&gt;as&lt;/span&gt; A&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;/*&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;--Here&#39;s a table of DST dates since 1970 to share at parties and impress your friends.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;DROP TABLE dbo.DSTDates &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;GO&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;&amp;nbsp;CREATE TABLE dbo.DSTDates&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;&amp;nbsp;( &amp;nbsp;BeginDate datetimeoffset(0)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;&amp;nbsp;, &amp;nbsp;EndDate datetimeoffset(0)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;&amp;nbsp;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;&amp;nbsp;GO&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;&amp;nbsp;CREATE CLUSTERED INDEX IDX_CL_DSTDates on dbo.DSTDates (BeginDate, EndDate)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;&amp;nbsp;GO&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;&amp;nbsp; INSERT INTO dbo.DSTDates (BeginDate, EndDate)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;VALUES &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;&amp;nbsp;(&#39;4/26/1970 02:00 -06:00&#39;,&#39;10/25/1970 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;4/25/1971 02:00 -06:00&#39;,&#39;10/31/1971 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;4/30/1972 02:00 -06:00&#39;,&#39;10/29/1972 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;4/29/1973 02:00 -06:00&#39;,&#39;10/28/1973 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;1/6/1974 02:00 -06:00&#39;,&#39;10/27/1974 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;2/23/1975 02:00 -06:00&#39;,&#39;10/26/1975 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;4/25/1976 02:00 -06:00&#39;,&#39;10/31/1976 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;4/24/1977 02:00 -06:00&#39;,&#39;10/30/1977 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;4/30/1978 02:00 -06:00&#39;,&#39;10/29/1978 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;4/29/1979 02:00 -06:00&#39;,&#39;10/28/1979 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;4/27/1980 02:00 -06:00&#39;,&#39;10/26/1980 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;4/26/1981 02:00 -06:00&#39;,&#39;10/25/1981 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;4/25/1982 02:00 -06:00&#39;,&#39;10/31/1982 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;4/24/1983 02:00 -06:00&#39;,&#39;10/30/1983 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;4/29/1984 02:00 -06:00&#39;,&#39;10/28/1984 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;4/28/1985 02:00 -06:00&#39;,&#39;10/27/1985 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;4/27/1986 02:00 -06:00&#39;,&#39;10/26/1986 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;4/5/1987 02:00 -06:00&#39;,&#39;10/25/1987 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;4/3/1988 02:00 -06:00&#39;,&#39;10/30/1988 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;4/2/1989 02:00 -06:00&#39;,&#39;10/29/1989 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;4/1/1990 02:00 -06:00&#39;,&#39;10/28/1990 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;4/7/1991 02:00 -06:00&#39;,&#39;10/27/1991 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;4/5/1992 02:00 -06:00&#39;,&#39;10/25/1992 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;4/4/1993 02:00 -06:00&#39;,&#39;10/31/1993 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;4/3/1994 02:00 -06:00&#39;,&#39;10/30/1994 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;4/2/1995 02:00 -06:00&#39;,&#39;10/29/1995 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;4/7/1996 02:00 -06:00&#39;,&#39;10/27/1996 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;4/6/1997 02:00 -06:00&#39;,&#39;10/26/1997 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;4/5/1998 02:00 -06:00&#39;,&#39;10/25/1998 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;4/4/1999 02:00 -06:00&#39;,&#39;10/31/1999 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;4/2/2000 02:00 -06:00&#39;,&#39;10/29/2000 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;4/1/2001 02:00 -06:00&#39;,&#39;10/28/2001 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;4/7/2002 02:00 -06:00&#39;,&#39;10/27/2002 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;4/6/2003 02:00 -06:00&#39;,&#39;10/26/2003 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;4/4/2004 02:00 -06:00&#39;,&#39;10/31/2004 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;4/3/2005 02:00 -06:00&#39;,&#39;10/30/2005 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;4/2/2006 02:00 -06:00&#39;,&#39;10/29/2006 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;3/11/2007 02:00 -06:00&#39;,&#39;11/4/2007 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;3/9/2008 02:00 -06:00&#39;,&#39;11/2/2008 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;3/8/2009 02:00 -06:00&#39;,&#39;11/1/2009 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;3/14/2010 02:00 -06:00&#39;,&#39;11/7/2010 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;3/13/2011 02:00 -06:00&#39;,&#39;11/6/2011 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;3/11/2012 02:00 -06:00&#39;,&#39;11/4/2012 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;3/10/2013 02:00 -06:00&#39;,&#39;11/3/2013 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;3/9/2014 02:00 -06:00&#39;,&#39;11/2/2014 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;3/8/2015 02:00 -06:00&#39;,&#39;11/1/2015 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;3/13/2016 02:00 -06:00&#39;,&#39;11/6/2016 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;3/12/2017 02:00 -06:00&#39;,&#39;11/5/2017 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;3/11/2018 02:00 -06:00&#39;,&#39;11/4/2018 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;3/10/2019 02:00 -06:00&#39;,&#39;11/3/2019 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;3/8/2020 02:00 -06:00&#39;,&#39;11/1/2020 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;3/14/2021 02:00 -06:00&#39;,&#39;11/7/2021 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;3/13/2022 02:00 -06:00&#39;,&#39;11/6/2022 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;3/12/2023 02:00 -06:00&#39;,&#39;11/5/2023 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;3/10/2024 02:00 -06:00&#39;,&#39;11/3/2024 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;3/9/2025 02:00 -06:00&#39;,&#39;11/2/2025 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;3/8/2026 02:00 -06:00&#39;,&#39;11/1/2026 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;3/14/2027 02:00 -06:00&#39;,&#39;11/7/2027 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;3/12/2028 02:00 -06:00&#39;,&#39;11/5/2028 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;3/11/2029 02:00 -06:00&#39;,&#39;11/4/2029 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;3/10/2030 02:00 -06:00&#39;,&#39;11/3/2030 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;3/9/2031 02:00 -06:00&#39;,&#39;11/2/2031 02:00 -05:00&#39;),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;(&#39;3/14/2032 02:00 -06:00&#39;,&#39;11/7/2032 02:00 -05:00&#39;)&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;*/&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;color: #212121; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;color: #212121; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;&lt;i style=&quot;color: black; font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium; white-space: normal;&quot;&gt;Yes, I know this blog post could have been written in 2016.&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;color: #212121; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;color: #212121; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;color: #212121; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;color: #212121; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.sqltact.com/feeds/586746000073237601/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/2328222207349876984/586746000073237601?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/2328222207349876984/posts/default/586746000073237601'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/2328222207349876984/posts/default/586746000073237601'/><link rel='alternate' type='text/html' href='https://www.sqltact.com/2024/05/migrate-datetime-data-to-datetimeoffset.html' title='Migrate datetime data to datetimeoffset with AT TIME ZONE'/><author><name>Unknown</name><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-2328222207349876984.post-7547295341868342718</id><published>2023-10-27T10:01:00.006-07:00</published><updated>2023-10-27T10:01:45.489-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="blogging"/><category scheme="http://www.blogger.com/atom/ns#" term="mvp"/><category scheme="http://www.blogger.com/atom/ns#" term="students"/><title type='text'>Tips, ideas, and recommendations on your technical blog</title><content type='html'>&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbYE4np9xSScxIyBiqnTD3qwvnTZdkwE0qexPALorPQA9DkOBhyphenhyphenyMLt7rXmph3d-o0WUlO3EjUDF_Gs1xXrj1KExr2zjfqFUsMFg3Xh7jpXDdxlhe3iNHZhoPW6MX_R9ngziYYESqKMyTsHrxCM9EeW_OhkyKk3Uq5VgVRliT-aUpjEAciVoRDLwKqawtz/s2549/technical%20writer%20mvp%20pgi.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1321&quot; data-original-width=&quot;2549&quot; height=&quot;166&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbYE4np9xSScxIyBiqnTD3qwvnTZdkwE0qexPALorPQA9DkOBhyphenhyphenyMLt7rXmph3d-o0WUlO3EjUDF_Gs1xXrj1KExr2zjfqFUsMFg3Xh7jpXDdxlhe3iNHZhoPW6MX_R9ngziYYESqKMyTsHrxCM9EeW_OhkyKk3Uq5VgVRliT-aUpjEAciVoRDLwKqawtz/s320/technical%20writer%20mvp%20pgi.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;This technical blog is hardly the ideal, but I&#39;ll use this space here to summarize some of the guidance that &lt;a href=&quot;https://www.linkedin.com/feed/update/urn:li:activity:7123709102064631808/&quot; target=&quot;_blank&quot;&gt;my colleague Randolph West and I presented at a Microsoft MVP PGI this week&lt;/a&gt;. Their summary and mine specifically on the technical blogging are hopefully a resource for you, especially if you are early in your career or a Microsoft Student Ambassador.&lt;p&gt;&lt;/p&gt;&lt;p&gt;Technical blogging can grow your technical depth and writing skillsets simultaneously. Ideas, tips, and recommendations:&lt;/p&gt;&lt;p&gt;Blog content ideas:&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Reference, samples, labs, especially for newcomers to the field.&lt;/li&gt;&lt;li&gt;Deep dives into a topic you&#39;re interested in.&lt;/li&gt;&lt;li&gt;Summaries and use cases of new features or changes.&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://learn.microsoft.com/en-us/fabric/get-started/whats-new&quot;&gt;What&#39;s new?&lt;/a&gt;&amp;nbsp;pages in Microsoft Docs are rich with blog ideas&lt;/li&gt;&lt;li&gt;Checklists, best practices and lessons learned are great blog content.&lt;/li&gt;&lt;li&gt;Your clients and customers are a fertile farm of reusable scripts, patterns and antipatterns, tools, and blog posts. &quot;It depends&quot; answers are great blog posts.&lt;/li&gt;&lt;li&gt;&amp;nbsp;Technically reusable content from client to client is a value add. A public bucket or toolbox of lessons learned is valuable.&lt;/li&gt;&lt;li&gt;&amp;nbsp;Remember the best way to learn a topic is to try and teach it (or explain it in a public blog).&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Tips on blogging:&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;You don&#39;t have to be unique (but don&#39;t plagiarize). You can write about any topic, even if it&#39;s been covered by bigger names. Your voice is valuable.&lt;/li&gt;&lt;li&gt;Don&#39;t steal content or plagiarize, but you can admire and emulate (and attribute with links) the style/format of another author or blogger. Emulate things you like about someone else&#39;s process or research style or content format.&lt;/li&gt;&lt;li&gt;Make it into a story if you can, &quot;It tried this, it broke, I tried this, it didn&#39;t work, I fixed it this way...&quot;&lt;/li&gt;&lt;li&gt;A problem with no solution is worth blogging about. Sometimes, blogging about a problem is a great way to work the problem, and figure it out in the process.&lt;/li&gt;&lt;li&gt;Write regularly, set a schedule. Pick a topic. Not every post has to be a novel.&lt;/li&gt;&lt;li&gt;Do you ever write too much? Blogging can be great practice in distilling the core problem/concept to a palatable, communicable summary. It&#39;s easy to be wordy and redundant. It&#39;s a skill to practice writing more concise technical summaries. &quot;If I Had More Time, I Would Have Written Less&quot;&lt;/li&gt;&lt;li&gt;Challenge your preconceived notions. Be humble in defeat and write about it. If you&#39;re proven wrong, your immediate reaction is usually to be defensive. The second reaction should be to learn from it, perhaps blog about it.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Get an editor, or volunteer to edit for blogs, newsletters, articles.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Ask for a volunteer (or pay a) technical editor for your own blog.&lt;/li&gt;&lt;li&gt;Listen to feedback. You trusted someone to edit you for a reason.&lt;/li&gt;&lt;li&gt;Edits can feel like a gut punch. Don&#39;t take it personally.&lt;/li&gt;&lt;li&gt;Politely ask to be someone else&#39;s volunteer technical editor for their blog.&lt;/li&gt;&lt;li&gt;Provide constructive feedback, challenge assumptions, test technical scripts.&lt;/li&gt;&lt;li&gt;Easier to find inconsistencies or gaps in someone else&#39;s work, it can be instructive to your own work.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.sqltact.com/feeds/7547295341868342718/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/2328222207349876984/7547295341868342718?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/2328222207349876984/posts/default/7547295341868342718'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/2328222207349876984/posts/default/7547295341868342718'/><link rel='alternate' type='text/html' href='https://www.sqltact.com/2023/10/tips-ideas-and-recommendations-on-your.html' title='Tips, ideas, and recommendations on your technical blog'/><author><name>Unknown</name><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><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbYE4np9xSScxIyBiqnTD3qwvnTZdkwE0qexPALorPQA9DkOBhyphenhyphenyMLt7rXmph3d-o0WUlO3EjUDF_Gs1xXrj1KExr2zjfqFUsMFg3Xh7jpXDdxlhe3iNHZhoPW6MX_R9ngziYYESqKMyTsHrxCM9EeW_OhkyKk3Uq5VgVRliT-aUpjEAciVoRDLwKqawtz/s72-c/technical%20writer%20mvp%20pgi.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2328222207349876984.post-5304911234514922193</id><published>2023-07-30T22:23:00.003-07:00</published><updated>2023-07-30T22:23:35.445-07:00</updated><title type='text'>Updated training list for a new DBA</title><content type='html'>&lt;p&gt;Met an eager young volunteer at &lt;a href=&quot;https://www.sqltact.com/2023/07/sqlsat-baton-rouge-2023.html&quot; target=&quot;_blank&quot;&gt;SQLSatBR&lt;/a&gt; over the weekend who inspired me to update a blog post that hadn&#39;t been refreshed in a few years. See the&amp;nbsp;&lt;a href=&quot;https://www.sqltact.com/2016/07/training-to-do-list-for-new-dba.html&quot; target=&quot;_blank&quot;&gt;[UPDATED] Training To-Do List for New DBA&lt;/a&gt;.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.sqltact.com/feeds/5304911234514922193/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/2328222207349876984/5304911234514922193?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/2328222207349876984/posts/default/5304911234514922193'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/2328222207349876984/posts/default/5304911234514922193'/><link rel='alternate' type='text/html' href='https://www.sqltact.com/2023/07/updated-training-list-for-new-dba.html' title='Updated training list for a new DBA'/><author><name>Unknown</name><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-2328222207349876984.post-7919477835365276939</id><published>2023-07-21T16:37:00.008-07:00</published><updated>2023-07-24T11:35:05.348-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="jambalaya"/><category scheme="http://www.blogger.com/atom/ns#" term="sqlsat"/><category scheme="http://www.blogger.com/atom/ns#" term="sqlsatbr"/><title type='text'>SQLSat Baton Rouge 2023!</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheddUnd5a69f34Ue2Df3ob2-7LTOXZyqpg9RSVPp0avVt8eYj-3d0Cxs3KgrJ7SXTpXpihUtFi08THFk-gM33kfa09H7nSRXyn4SODfqAgggzyx6AIJK7POcV3uOw53Oh4D1kfye9y4ePr1livuLnKnhX8LzFkowGEThRg5_SFuHVN4HMd0JjLozcykzMO/s120/sqlsaturday%20icon%20small.png&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;69&quot; data-original-width=&quot;120&quot; height=&quot;69&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheddUnd5a69f34Ue2Df3ob2-7LTOXZyqpg9RSVPp0avVt8eYj-3d0Cxs3KgrJ7SXTpXpihUtFi08THFk-gM33kfa09H7nSRXyn4SODfqAgggzyx6AIJK7POcV3uOw53Oh4D1kfye9y4ePr1livuLnKnhX8LzFkowGEThRg5_SFuHVN4HMd0JjLozcykzMO/s1600/sqlsaturday%20icon%20small.png&quot; width=&quot;120&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Looking forward to #jambalaya at #SQLSatBR on July 29! &lt;br /&gt;&lt;br /&gt;Register today: &lt;a href=&quot;https://www.sqlsatbr.com&quot;&gt;sqlsatbr.com&lt;/a&gt;&lt;div&gt;&lt;br /&gt;I hope to see as many people as possible that weekend, I&#39;ll be there at the Friday night speaker event.&lt;br /&gt;&lt;br /&gt;On Saturday, I am speaking at:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;9:45am about how you can contribute to the same Microsoft Docs I work on every day, &lt;a href=&quot;https://sqlsaturday.com/2023-07-29-sqlsaturday1060//#&quot;&gt;Microsoft Docs + GitHub + You&lt;/a&gt;. &lt;a href=&quot;https://github.com/williamadba/Public-Presentations/tree/main/SQLSat%20Baton%20Rouge%202023&quot; target=&quot;_blank&quot;&gt;Slidedeck available for download&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;11am I&#39;ll be moderating the annual panel conversation about &lt;a href=&quot;https://sqlsaturday.com/2023-07-29-sqlsaturday1060//#&quot;&gt;Careers in IT Baton Rouge 2023&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;1:15pm after lunch meet me in the big auditorium for a brand new exciting&amp;nbsp;&lt;a href=&quot;https://sqlsaturday.com/2023-07-29-sqlsaturday1060//#&quot;&gt;SQL Saturday Jeopardy! A Quiz Show for Devs and Data Pros&lt;/a&gt;. I&#39;m still looking for at least one more contestant, &lt;a href=&quot;https://www.linkedin.com/in/williamdassaf/&quot; target=&quot;_blank&quot;&gt;reach out to me on LinkedIn&lt;/a&gt; if you&#39;re interested!&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;See you there!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.sqltact.com/feeds/7919477835365276939/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/2328222207349876984/7919477835365276939?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/2328222207349876984/posts/default/7919477835365276939'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/2328222207349876984/posts/default/7919477835365276939'/><link rel='alternate' type='text/html' href='https://www.sqltact.com/2023/07/sqlsat-baton-rouge-2023.html' title='SQLSat Baton Rouge 2023!'/><author><name>Unknown</name><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><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheddUnd5a69f34Ue2Df3ob2-7LTOXZyqpg9RSVPp0avVt8eYj-3d0Cxs3KgrJ7SXTpXpihUtFi08THFk-gM33kfa09H7nSRXyn4SODfqAgggzyx6AIJK7POcV3uOw53Oh4D1kfye9y4ePr1livuLnKnhX8LzFkowGEThRg5_SFuHVN4HMd0JjLozcykzMO/s72-c/sqlsaturday%20icon%20small.png" height="72" width="72"/><thr:total>0</thr:total></entry></feed>