<?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-28468793</id><updated>2025-11-24T19:42:08.293+08:00</updated><category term="book review"/><category term="design"/><category term="microsoft"/><category term="C#"/><category term="html"/><category term=".NET"/><category term=".NET Framework"/><category term="ASP.NET"/><category term="Code"/><category term="IDE"/><category term="SQL Azure"/><category term="SQL Server"/><category term="analysis"/><category term="ankh"/><category term="ankhsvn"/><category term="certification"/><category term="chance"/><category term="control adaptors"/><category term="css"/><category term="famous"/><category term="head first"/><category term="quote"/><category term="regex"/><category term="singleton"/><category term="snippet"/><category term="source control"/><category term="subversion"/><category term="tags"/><category term="visual studio 2005"/><title type='text'>Mitch Wheat - Treat the cause, not the symptoms!</title><subtitle type='html'>SQL Server, Analytics, .Net, Machine Learning, R, Python </subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='https://mitch-wheat.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default?alt=atom'/><link rel='alternate' type='text/html' href='https://mitch-wheat.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default?alt=atom&amp;start-index=26&amp;max-results=25'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</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>791</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-28468793.post-4230192044654788862</id><published>2018-02-27T19:49:00.001+08:00</published><updated>2018-02-27T19:49:30.964+08:00</updated><title type='text'>Blog moved…</title><content type='html'>&lt;p&gt;I’ve moved this blog and content to &lt;a href=&quot;https://mitchwheat.com/blog/&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='https://mitch-wheat.blogspot.com/feeds/4230192044654788862/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/28468793/4230192044654788862' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/4230192044654788862'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/4230192044654788862'/><link rel='alternate' type='text/html' href='https://mitch-wheat.blogspot.com/2018/02/blog-moved.html' title='Blog moved…'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</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-28468793.post-6041456628261760869</id><published>2018-02-22T16:04:00.001+08:00</published><updated>2018-02-23T13:04:40.896+08:00</updated><title type='text'>Postgres Configuration</title><content type='html'>&lt;p&gt;Configuration file locations: &lt;blockquote&gt;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/3602450/where-are-my-postgres-conf-files&quot;&gt;Where are my postgres *.conf files?&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;h3&gt;&lt;a href=&quot;https://stackoverflow.com/questions/4465475/where-is-the-postgresql-config-file-postgresql-conf-on-windows&quot;&gt;&lt;font size=&quot;2&quot; style=&quot;font-weight: normal;&quot;&gt;Where is the Postgresql config file: &#39;postgresql.conf&#39; on Windows?&lt;/font&gt;&lt;/a&gt;&lt;/h3&gt;&lt;/blockquote&gt;&lt;ul&gt;&lt;li&gt;Windows: C:\Program Files\PostgreSQL\x.x\data\postgresql.conf&lt;/li&gt;&lt;li&gt;Linux: /etc/postgresql/x.x/main/postgresql.conf&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Go to bottom of .conf file, and add this line:&lt;blockquote&gt;&lt;p&gt;&lt;font face=&quot;Courier New&quot;&gt;include postgresql.custom.conf&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;Then create file ‘postgresql.custom.conf’ in the same directory and place your customised configuration settings in it. Any settings set in the custom file will override those in the main config.&lt;p&gt;Navigate to &lt;a href=&quot;https://pgtune.leopard.in.ua/&quot;&gt;pgtune&lt;/a&gt; and enter the required information, and pgtune will generate custom settings based upon total RAM size and intended use etc:&lt;p&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglF_J-LZvvcoEBCCAclcdQP8utzL1NpAUabKrZfCZOSLJ_TtO_75Tzw8pcQnkJIv9IMKa_GI3yPlh7RZdtpbnuNKP8rcs0ZN04cs7jB4sJEelOzeMAb6nXvcBCZwk_BadM02cRlA/s1600-h/image%255B2%255D&quot;&gt;&lt;img width=&quot;244&quot; height=&quot;225&quot; title=&quot;image&quot; style=&quot;margin: 0px; display: inline; background-image: none;&quot; alt=&quot;image&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZGP99N7f0ZVeVq3db-rRUz9MJONMdf_sqztu7DXSHCKvHedy5liYkSV3ICaravxpxWi0tHz6vnfC5cxuwMISSbPrXaBdk-xS1vyuZUEwi8HS3UyUWH-YlQuRdFCLAa9_wfyDX7A/?imgmax=800&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;p&gt;Copy the generated settings into file ‘postgresql.custom.conf’: &lt;blockquote&gt;&lt;p&gt;&lt;font face=&quot;Courier New&quot;&gt;max_connections = 100&lt;br&gt;
shared_buffers = 8GB&lt;br&gt;
effective_cache_size = 24GB&lt;br&gt;
work_mem = 83886kB&lt;br&gt;
maintenance_work_mem = 2GB&lt;br&gt;
min_wal_size = 2GB&lt;br&gt;
max_wal_size = 4GB&lt;br&gt;
checkpoint_completion_target = 0.9&lt;br&gt;
wal_buffers = 16MB&lt;br&gt;
default_statistics_target = 100&lt;br&gt;
random_page_cost = 1.1&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;Restart Postgres.&lt;/p&gt;&lt;p&gt;Further reading on Postgres performance: &lt;a title=&quot;http://www.craigkerstiens.com&quot; href=&quot;http://www.craigkerstiens.com&quot;&gt;http://www.craigkerstiens.com&lt;/a&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='https://mitch-wheat.blogspot.com/feeds/6041456628261760869/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/28468793/6041456628261760869' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/6041456628261760869'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/6041456628261760869'/><link rel='alternate' type='text/html' href='https://mitch-wheat.blogspot.com/2018/02/postgres-configuration.html' title='Postgres Configuration'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</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><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZGP99N7f0ZVeVq3db-rRUz9MJONMdf_sqztu7DXSHCKvHedy5liYkSV3ICaravxpxWi0tHz6vnfC5cxuwMISSbPrXaBdk-xS1vyuZUEwi8HS3UyUWH-YlQuRdFCLAa9_wfyDX7A/s72-c?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-2568479695450133770</id><published>2018-02-14T10:36:00.001+08:00</published><updated>2018-02-14T10:36:19.807+08:00</updated><title type='text'>Do you Encrypt your Remote Connections to SQL Azure Databases?</title><content type='html'>&lt;p&gt;If you’re not encrypting connections to SQL Azure (or any remote SQL Server instance), then you probably should.&lt;/p&gt;&lt;p&gt;Encrypted connections to SQL Server &lt;a href=&quot;https://technet.microsoft.com/en-us/library/ms189067(v=sql.105).aspx&quot;&gt;use SSL&lt;/a&gt;,&amp;nbsp; and that is about as secure as you can get (currently). &lt;/p&gt;&lt;p&gt;[&lt;strong&gt;Remember&lt;/strong&gt;: SSL protects only the &lt;em&gt;connection&lt;/em&gt;, i.e. the data as it is transmitted ‘on the wire’ between the client and SQL Server. It says nothing about how the data is &lt;em&gt;actually&lt;/em&gt; &lt;em&gt;stored&lt;/em&gt; on the server].&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;&lt;h3&gt;SSMS&lt;/h3&gt;&lt;p&gt;When you open SSMS’s ‘Connect to Server’ dialog, click the bottom right ‘Options’ button, and make sure you tick the checkbox ‘Encrypt Connection’:&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgX2vBC5LTg4zKtDHAGPEGeR49dcI4MoQrCHxtMEaKT9WTt15_v4ax1LFRpnFL1lVxvkUuog6hOhuroLVtXXHC2YL9D7HMuH4JakdE3d7o_6eLknYCU0cZtsgW8ZnxL_vPDdAkg9w/s1600-h/image%255B8%255D&quot;&gt;&lt;img width=&quot;224&quot; height=&quot;244&quot; title=&quot;image&quot; style=&quot;display: inline; background-image: none;&quot; alt=&quot;image&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUgZo3cV4hTAEKS5BTCHpLywMT31O8lPf056Pg-5lRy4F7nnWouw4uAcB0iOfiTmwYFUNSeENv5BK1xRSSzN78Qz8fBcjtG-w-2WxotkRp86Ybv8hjs-o37JFRrNPsdncoFucRcw/?imgmax=800&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;&lt;h3&gt;SQLCMD&lt;/h3&gt;&lt;p&gt;Ensure you add the &lt;strong&gt;-N&lt;/strong&gt; command line option. The &lt;strong&gt;-N&lt;/strong&gt; switch is used by the client to request an encrypted connection. This option is equivalent to the ADO.net option &lt;code&gt;&lt;font color=&quot;#000000&quot;&gt;ENCRYPT = true&lt;/font&gt;&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;e.g.&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;font face=&quot;Courier New&quot;&gt;sqlcmd –N –U username –P password&amp;nbsp; –S servername –d databasename –Q “SELECT * FROM myTable”&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;&lt;h3&gt;Linked Servers&lt;/h3&gt;&lt;p&gt;When &lt;a href=&quot;https://mitch-wheat.blogspot.com.au/2016/06/sql-server-create-linked-server-from-on.html&quot;&gt;creating a linked server to SQL Azure&lt;/a&gt;,&amp;nbsp; the&lt;font face=&quot;Courier New&quot;&gt; @provstr&lt;/font&gt; parameter must be set to &#39;&lt;font face=&quot;Courier New&quot;&gt;Encrypt=yes;&lt;/font&gt;’:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;font face=&quot;Courier New&quot;&gt;-- Create the linked server: &lt;/font&gt;&lt;/p&gt;&lt;font face=&quot;Courier New&quot;&gt;
&lt;/font&gt;&lt;p&gt;&lt;font face=&quot;Courier New&quot;&gt;EXEC sp_addlinkedserver&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @server&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = &#39;LocalLinkedServername&#39;,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @srvproduct = N&#39;Any&#39;,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @provider&amp;nbsp;&amp;nbsp; = &#39;SQLNCLI&#39;,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @datasrc&amp;nbsp;&amp;nbsp;&amp;nbsp; = &#39;???.database.windows.net&#39;, -- Azure server name&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @location&amp;nbsp;&amp;nbsp; = &#39;&#39;,&lt;br&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @provstr&amp;nbsp;&amp;nbsp;&amp;nbsp; = N&#39;Encrypt=yes;&#39;,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -- &amp;lt;&amp;lt;--&amp;nbsp; Important!&lt;/strong&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @catalog&amp;nbsp;&amp;nbsp;&amp;nbsp; = &#39;RemoteDatabaseName&#39;;&amp;nbsp; -- remote(Azure) database name&lt;br&gt;
go&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;&lt;h3&gt;ADO.NET Connection strings&lt;/h3&gt;&lt;p&gt;Add “&lt;code&gt;&lt;font color=&quot;#000000&quot;&gt;&lt;font face=&quot;Trebuchet MS&quot;&gt;ENCRYPT = true” to your connection string, or set the &lt;/font&gt;&lt;/font&gt;&lt;/code&gt;&lt;font face=&quot;Courier New&quot;&gt;SqlConnectionStringBuilder&lt;/font&gt; property to True.&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;p&gt;[Remember: don’t distribute passwords by sending as plaintext over the Internet, i.e. don’t email passwords! ]</content><link rel='replies' type='application/atom+xml' href='https://mitch-wheat.blogspot.com/feeds/2568479695450133770/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/28468793/2568479695450133770' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/2568479695450133770'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/2568479695450133770'/><link rel='alternate' type='text/html' href='https://mitch-wheat.blogspot.com/2018/02/do-you-encrypt-your-remote-connections.html' title='Do you Encrypt your Remote Connections to SQL Azure Databases?'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</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><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUgZo3cV4hTAEKS5BTCHpLywMT31O8lPf056Pg-5lRy4F7nnWouw4uAcB0iOfiTmwYFUNSeENv5BK1xRSSzN78Qz8fBcjtG-w-2WxotkRp86Ybv8hjs-o37JFRrNPsdncoFucRcw/s72-c?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-7779743842840001263</id><published>2018-02-06T09:59:00.001+08:00</published><updated>2018-02-15T14:39:51.456+08:00</updated><title type='text'>Installing TensorFlow with GPU support on Windows 10</title><content type='html'>&lt;p&gt;If you have a high end NVidia graphics card and you’re investigating data science with Keras+Tensorflow, then you obviously want Tensorflow to take advantage of your GPU (training times for deep neural networks can be 10 – 15 times faster even when compared to the latest CPUs).&lt;/p&gt;&lt;p&gt;Getting it all working can be tricky: I found this guide that explains the steps: &lt;a href=&quot;http://www.laurencemoroney.com/installing-tensorflow-with-gpu-on-windows-10/&quot;&gt;Installing TensorFlow with GPU on Windows 10&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Here’s another: &lt;a href=&quot;http://bailiwick.io/2017/11/05/tensorflow-gpu-windows-and-jupyter/&quot;&gt;How to run TensorFlow with GPU on Windows 10 in a Jupyter Notebook&lt;/a&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='https://mitch-wheat.blogspot.com/feeds/7779743842840001263/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/28468793/7779743842840001263' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/7779743842840001263'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/7779743842840001263'/><link rel='alternate' type='text/html' href='https://mitch-wheat.blogspot.com/2018/02/installing-tensorflow-with-gpu-support.html' title='Installing TensorFlow with GPU support on Windows 10'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</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-28468793.post-2049459486591068449</id><published>2018-01-25T11:06:00.001+08:00</published><updated>2018-01-25T11:06:19.815+08:00</updated><title type='text'>Free e-Learning Books at Packt</title><content type='html'>&lt;p&gt;Just came across this link at Packt: &lt;a title=&quot;https://www.packtpub.com/packt/offers/free-learning&quot; href=&quot;https://www.packtpub.com/packt/offers/free-learning&quot;&gt;https://www.packtpub.com/packt/offers/free-learning&lt;/a&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='https://mitch-wheat.blogspot.com/feeds/2049459486591068449/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/28468793/2049459486591068449' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/2049459486591068449'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/2049459486591068449'/><link rel='alternate' type='text/html' href='https://mitch-wheat.blogspot.com/2018/01/free-e-learning-books-at-packt.html' title='Free e-Learning Books at Packt'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</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-28468793.post-5771186460935212347</id><published>2018-01-24T17:38:00.001+08:00</published><updated>2018-01-24T17:38:38.968+08:00</updated><title type='text'>The Zen of Python</title><content type='html'>&lt;p&gt;I’ve recently been learning Python with the goal of using it alongside R for data science. It’s got a lot going for it as a language and the package (library) support covers just about every domain you can think of.&lt;/p&gt;&lt;p&gt;Many of the ‘C’ like languages seem intent on creating too much complexity for no other reason than ‘you can’, but Python takes a more pragmatic approach.&lt;/p&gt;&lt;p&gt;I particularly like the Zen of Python (&lt;strong&gt;PEP 20&lt;/strong&gt;):&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;strong&gt;The Zen of Python, by Tim Peters&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Beautiful is better than ugly.&lt;br&gt;
Explicit is better than implicit.&lt;br&gt;
Simple is better than complex.&lt;br&gt;
Complex is better than complicated.&lt;br&gt;
Flat is better than nested.&lt;br&gt;
Sparse is better than dense.&lt;br&gt;
Readability counts.&lt;br&gt;
Special cases aren&#39;t special enough to break the rules.&lt;br&gt;
Although practicality beats purity.&lt;br&gt;
Errors should never pass silently.&lt;br&gt;
Unless explicitly silenced.&lt;br&gt;
In the face of ambiguity, refuse the temptation to guess.&lt;br&gt;
There should be one-- and preferably only one --obvious way to do it.&lt;br&gt;
Although that way may not be obvious at first unless you&#39;re Dutch.&lt;br&gt;
Now is better than never.&lt;br&gt;
Although never is often better than *right* now.&lt;br&gt;
If the implementation is hard to explain, it&#39;s a bad idea.&lt;br&gt;
If the implementation is easy to explain, it may be a good idea.&lt;br&gt;
Namespaces are one honking great idea -- let&#39;s do more of those!&lt;/p&gt;&lt;/blockquote&gt;</content><link rel='replies' type='application/atom+xml' href='https://mitch-wheat.blogspot.com/feeds/5771186460935212347/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/28468793/5771186460935212347' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/5771186460935212347'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/5771186460935212347'/><link rel='alternate' type='text/html' href='https://mitch-wheat.blogspot.com/2018/01/the-zen-of-python.html' title='The Zen of Python'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</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-28468793.post-1921733067251607667</id><published>2017-12-19T10:37:00.003+08:00</published><updated>2017-12-19T10:37:49.820+08:00</updated><title type='text'>More SQL Server Trace Flags</title><content type='html'>Another &lt;a href=&quot;https://github.com/ktaranov/sqlserver-kit/blob/master/SQL%20Server%20Trace%20Flag.md&quot; target=&quot;_blank&quot;&gt;SQL Server Trace Flags&lt;/a&gt; resource (in addition to the Microsoft &lt;a href=&quot;https://docs.microsoft.com/en-us/sql/t-sql/database-console-commands/dbcc-traceon-trace-flags-transact-sql&quot; target=&quot;_blank&quot;&gt;one&lt;/a&gt;).&lt;br /&gt;
&lt;br /&gt;
There are a bunch of SQL Server resources hosted there, &lt;a href=&quot;https://github.com/ktaranov/sqlserver-kit&quot; target=&quot;_blank&quot;&gt;SQL Server Kit&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='https://mitch-wheat.blogspot.com/feeds/1921733067251607667/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/28468793/1921733067251607667' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/1921733067251607667'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/1921733067251607667'/><link rel='alternate' type='text/html' href='https://mitch-wheat.blogspot.com/2017/12/more-sql-server-trace-flags.html' title='More SQL Server Trace Flags'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</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-28468793.post-561815629040033627</id><published>2017-12-16T16:05:00.001+08:00</published><updated>2017-12-16T16:05:02.880+08:00</updated><title type='text'>SQLDiagCmd Updated</title><content type='html'>&lt;p&gt;I’ve updated &lt;a href=&quot;https://mitch-wheat.blogspot.com.au/2013/01/sqldiagcmd-standalone-runner-for-glenn.html&quot;&gt;SQLDiagCmd&lt;/a&gt;, my standalone executable for running any or all of &lt;a href=&quot;https://www.sqlskills.com/blogs/glenn/&quot;&gt;Glenn Berry&lt;/a&gt;’s excellent &lt;a href=&quot;https://www.sqlskills.com/blogs/glenn/category/dmv-queries/&quot;&gt;SQL Server DMV diagnostic scripts&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;As well as being able to target multiple servers and multiple databases, it now also has the option to exclude specified queries from being executed (such as those that might take some time to execute on large very databases or busy server instances).&lt;/p&gt;&lt;p&gt;The source code is available on &lt;a href=&quot;https://github.com/Mitch-Wheat/SQLDiagCmd&quot;&gt;GitHub&lt;/a&gt; and you can download the executable directly from these links:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;a href=&quot;https://app.box.com/s/f5vxtst2nk6f70y3z7xjf6rotb7cnaxj&quot;&gt;SQLDiagCmd.zip&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;p&gt;&lt;a href=&quot;https://app.box.com/s/vjn6umy8c40z8l402kikrdbduvvv4u9w&quot;&gt;SQLDiagUI.zip&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;</content><link rel='replies' type='application/atom+xml' href='https://mitch-wheat.blogspot.com/feeds/561815629040033627/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/28468793/561815629040033627' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/561815629040033627'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/561815629040033627'/><link rel='alternate' type='text/html' href='https://mitch-wheat.blogspot.com/2017/12/sqldiagcmd-updated.html' title='SQLDiagCmd Updated'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</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-28468793.post-6440064753644124069</id><published>2017-12-14T13:10:00.001+08:00</published><updated>2017-12-14T13:10:50.185+08:00</updated><title type='text'>A recursive C# function</title><content type='html'>&lt;p&gt;I was searching through email today looking for a &lt;a href=&quot;http://www.linqpad.net/&quot;&gt;LINQPad&lt;/a&gt; snippet that a colleague, &lt;a href=&quot;https://jamesmiles.wordpress.com&quot;&gt;James Miles&lt;/a&gt;, wrote some time ago, one which we used to generate the scripts for a production SQL Server database + transaction log point in time restore after IT had a little SAN mishap! &lt;/p&gt;&lt;p&gt;In doing so, I came across this gem from James: &lt;a href=&quot;https://jamesmiles.wordpress.com/2014/08/13/solving-puzzles-in-c-poker-hands/&quot;&gt;Solving Puzzles in C#: Poker Hands&lt;/a&gt;, which is not just a great example of writing a recursive function but of problem solving in general. [Where I used to work, we often used to have a Friday puzzle where I tried to come up with or find puzzles that wouldn’t be easy to solve by brute force.&amp;nbsp; This was one of the many times I was thwarted by James and others!]&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='https://mitch-wheat.blogspot.com/feeds/6440064753644124069/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/28468793/6440064753644124069' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/6440064753644124069'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/6440064753644124069'/><link rel='alternate' type='text/html' href='https://mitch-wheat.blogspot.com/2017/12/a-recursive-c-function.html' title='A recursive C# function'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</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-28468793.post-498666754933517933</id><published>2017-11-14T13:07:00.000+08:00</published><updated>2017-11-14T13:07:01.672+08:00</updated><title type='text'>SQL Server: A more useful CXPacket Waits...</title><content type='html'>&lt;span style=&quot;background-color: white; color: #333333; font-family: &amp;quot;Segoe UI&amp;quot;, Tahoma, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 14px;&quot;&gt;Starting with the upcoming SQL Server 2017 CU3 and SQL Server 2016 SP2 releases,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &amp;quot;Segoe UI&amp;quot;, Tahoma, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 14px;&quot;&gt;CXPACKET waits are split into an actionable wait (&lt;/span&gt;&lt;span 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; font-weight: 700;&quot;&gt;CXPACKET&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &amp;quot;Segoe UI&amp;quot;, Tahoma, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 14px;&quot;&gt;) and a negligible wait (&lt;/span&gt;&lt;span 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; font-weight: 700;&quot;&gt;CXCONSUMER&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &amp;quot;Segoe UI&amp;quot;, Tahoma, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 14px;&quot;&gt;).&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: &amp;quot;Segoe UI&amp;quot;, Tahoma, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 14px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: &amp;quot;Segoe UI&amp;quot;, Tahoma, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 14px;&quot;&gt;(these wait types are already present in Azure SQL Database).&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogs.msdn.microsoft.com/sql_server_team/making-parallelism-waits-actionable/&quot; style=&quot;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;&quot; target=&quot;_blank&quot;&gt;Making parallelism waits actionable&lt;/a&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: &amp;quot;Segoe UI&amp;quot;, Tahoma, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 14px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='https://mitch-wheat.blogspot.com/feeds/498666754933517933/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/28468793/498666754933517933' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/498666754933517933'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/498666754933517933'/><link rel='alternate' type='text/html' href='https://mitch-wheat.blogspot.com/2017/11/sql-server-more-useful-cxpacket-waits.html' title='SQL Server: A more useful CXPacket Waits...'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</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-28468793.post-4445051227041439518</id><published>2017-11-01T12:44:00.001+08:00</published><updated>2017-11-01T12:44:08.261+08:00</updated><title type='text'>SQL Server Trace Flags</title><content type='html'>Microsoft have published a useful list of all SQL Server trace flags in a single location:&amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;br /&gt;
&lt;a href=&quot;https://docs.microsoft.com/en-us/sql/t-sql/database-console-commands/dbcc-traceon-trace-flags-transact-sql&quot; target=&quot;_blank&quot;&gt;DBCC TRACEON - Trace Flags&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
In the past, some of these were poorly documented or hard to find.&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='https://mitch-wheat.blogspot.com/feeds/4445051227041439518/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/28468793/4445051227041439518' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/4445051227041439518'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/4445051227041439518'/><link rel='alternate' type='text/html' href='https://mitch-wheat.blogspot.com/2017/11/sql-server-trace-flags.html' title='SQL Server Trace Flags'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</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-28468793.post-93985657165147753</id><published>2017-10-25T07:29:00.001+08:00</published><updated>2017-10-25T07:29:51.562+08:00</updated><title type='text'>Shared Memory Protocol is not Supported on SQL Server Failover Clusters</title><content type='html'>&lt;p&gt;I was recently trying to work out why SSAS installed on the same server as SQL Server would not use shared memory for its processing connections. It may be obvious to some people, but an internet search turns up surprising few references: &lt;strong&gt;the Shared Memory Protocol is not Supported on SQL Server Failover Clusters.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;On a standard SQL Server instance, the Shared Memory protocol can be used when a client is running on the same computer as the SQL Server instance and the Shared Memory Protocol is enabled in SQL Server’s network protocols. (You can check the status of the enabled protocols using SQL Server Configuration Manager).&lt;/p&gt;&lt;p&gt;&lt;font face=&quot;Courier New&quot;&gt;sys.dm_exec_connections&lt;/font&gt; will show you which net transport a client connection is using:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;font face=&quot;Courier New&quot;&gt;SELECT net_transport FROM sys.dm_exec_connections WHERE session_id = @@SPID;&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;You can force a client connection to use a specific protocol by prefixing the Server name in the connection string with one of these modifiers:&lt;ul&gt;&lt;li&gt;TCP: tcp:&lt;/li&gt;&lt;li&gt;Multiprotocol = rpc:&lt;/li&gt;&lt;li&gt;Shared Memory = lpc:&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;e.g. Force connection to use the TCP protocol:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;font face=&quot;Courier New&quot;&gt;Server=tcp:MyServerName;Database=MyDB;Trusted_Connection=True;&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;In addition, you can force the client connection to use the Shared Memory protocol by using &lt;font face=&quot;Courier New&quot;&gt;(local)&lt;/font&gt; as the server name. You can also use &lt;font face=&quot;Courier New&quot;&gt;localhost&lt;/font&gt; or a period (&lt;font face=&quot;Courier New&quot;&gt;.&lt;/font&gt;) e.g.:&lt;blockquote&gt;&lt;p&gt;&lt;font face=&quot;Courier New&quot;&gt;Server=(local);Database=AdventureWorks;Trusted_Connection=True;&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;a title=&quot;https://support.microsoft.com/en-au/help/313295/how-to-use-the-server-name-parameter-in-a-connection-string-to-specify&quot; href=&quot;https://support.microsoft.com/en-au/help/313295/how-to-use-the-server-name-parameter-in-a-connection-string-to-specify&quot;&gt;https://support.microsoft.com/en-au/help/313295/how-to-use-the-server-name-parameter-in-a-connection-string-to-specify&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='https://mitch-wheat.blogspot.com/feeds/93985657165147753/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/28468793/93985657165147753' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/93985657165147753'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/93985657165147753'/><link rel='alternate' type='text/html' href='https://mitch-wheat.blogspot.com/2017/10/shared-memory-protocol-is-not-supported.html' title='Shared Memory Protocol is not Supported on SQL Server Failover Clusters'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</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-28468793.post-5675468736939402392</id><published>2017-10-17T06:53:00.001+08:00</published><updated>2017-10-17T06:53:57.539+08:00</updated><title type='text'>SSMS 17.3 has XE Profiler built-in</title><content type='html'>&lt;p&gt;New to SQL Server Manager Studio (SSMS) 17.3 is the XE Profiler. This is Profiler-like functionality built-in to SSMS:&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://sqlblog.com/blogs/tibor_karaszi/archive/2017/10/10/ssms-17-3-has-profiler-built-in.aspx&quot;&gt;SSMS 17.3 has Profiler built-in&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9LiMFz75POG-OQQJTNWkI2JtB76P4U4aHyVS8x65enzv7WeYFhF8oVUaJMI4dfg2P5jDCYJACygdEIzvCJ10uejUPG0Whz_gSNLO4AGHPOdk4Vkfctsag94dT8zqT1AqREmR6gw/s1600-h/image%255B2%255D&quot;&gt;&lt;img width=&quot;214&quot; height=&quot;139&quot; title=&quot;image&quot; style=&quot;margin: 0px; display: inline; background-image: none;&quot; alt=&quot;image&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_LzbZbIX5S57XuOhhlXrpVZUbkzNR8uxN-zDS0wUMhKUAZGUKM24-ApdvcyAiC5NsQ3OLczF4fgC-42FF3BVTq23q2qkdsqedHeTMabJ3twBv7QE2EA8XF4epCzwwLT_bhyUU6w/?imgmax=800&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Just double-click either of the two entries to create a live trace window (built on the SSMS XE “Watch Live Data” functionality).&amp;nbsp; The event sessions that will be created are named:&lt;ul&gt;&lt;li&gt;Standard:&amp;nbsp; QuickSessionStandard&lt;/li&gt;&lt;li&gt;TSQL:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; QuickSessionTSQL&lt;/li&gt;&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='https://mitch-wheat.blogspot.com/feeds/5675468736939402392/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/28468793/5675468736939402392' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/5675468736939402392'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/5675468736939402392'/><link rel='alternate' type='text/html' href='https://mitch-wheat.blogspot.com/2017/10/ssms-173-has-xe-profiler-built-in.html' title='SSMS 17.3 has XE Profiler built-in'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</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><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_LzbZbIX5S57XuOhhlXrpVZUbkzNR8uxN-zDS0wUMhKUAZGUKM24-ApdvcyAiC5NsQ3OLczF4fgC-42FF3BVTq23q2qkdsqedHeTMabJ3twBv7QE2EA8XF4epCzwwLT_bhyUU6w/s72-c?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-4308817133883918195</id><published>2017-10-13T07:31:00.001+08:00</published><updated>2017-10-13T07:32:36.293+08:00</updated><title type='text'>SSAS: Turn Off Flight Recorder</title><content type='html'>&lt;p&gt;A quick and easy SSAS optimisation: turn off flight recorder:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;SQL Server Analysis Services Flight Recorder provides a mechanism to record server activity into a short-term log. Information captured by Flight Recorder can be helpful for troubleshooting specific issues, however the load placed on the server when capturing the snapshots and trace events can have a small impact on overall performance.&amp;nbsp; &lt;font style=&quot;background-color: rgb(255, 255, 0);&quot;&gt;For optimal performance the flight recorder should be disabled unless attempting to capture diagnostic information relevant to troubleshooting a specific problem.&lt;/font&gt;&lt;u&gt;&lt;/u&gt;&lt;u&gt;&lt;/u&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;u&gt;&lt;/u&gt;&lt;u&gt;&lt;/u&gt;&lt;p&gt;&lt;a href=&quot;https://support.microsoft.com/en-au/help/2128005/flight-recorder-eanbled-for-sql-server-analysis-services&quot;&gt;https://support.microsoft.com/en-au/help/2128005/flight-recorder-eanbled-for-sql-server-analysis-services&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a title=&quot;http://byobi.com/2016/01/ever-wondered-whats-captured-in-the-ssas-flight-recorder/&quot; href=&quot;http://byobi.com/2016/01/ever-wondered-whats-captured-in-the-ssas-flight-recorder/&quot;&gt;http://byobi.com/2016/01/ever-wondered-whats-captured-in-the-ssas-flight-recorder/&lt;/a&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='https://mitch-wheat.blogspot.com/feeds/4308817133883918195/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/28468793/4308817133883918195' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/4308817133883918195'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/4308817133883918195'/><link rel='alternate' type='text/html' href='https://mitch-wheat.blogspot.com/2017/10/ssas-turn-off-flight-recorder.html' title='SSAS: Turn Off Flight Recorder'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</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-28468793.post-1304315109081985757</id><published>2017-10-04T13:15:00.001+08:00</published><updated>2017-10-05T15:52:14.489+08:00</updated><title type='text'>SQL Server: Do You Have a Poorly Performing Query you can&#39;t Explain?</title><content type='html'>If you are running a SQL Server version prior to SQL Server 2016, and you have a query whose plan just doesn&#39;t seem right and you can&#39;t explain it, try running it with trace flag &lt;b&gt;4199&lt;/b&gt;&lt;br /&gt;
&lt;br /&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;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; SomeColum
FROM SomeTable
OPTION(QUERYTRACEON 4199)
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
It enables all the query optimiser hot fixes present in your applied SP and CU version.&lt;br /&gt;
Many DBAs enable this trace flag globally (at the instance level).&lt;br /&gt;
SQL Server 2016 will automatically enable all prior version query optimiser hot fixes.&lt;br /&gt;
&lt;a href=&quot;https://support.microsoft.com/en-au/help/974006/sql-server-query-optimizer-hotfix-trace-flag-4199-servicing-model&quot; target=&quot;_blank&quot;&gt;&lt;br /&gt;&lt;/a&gt;
&lt;a href=&quot;https://support.microsoft.com/en-au/help/974006/sql-server-query-optimizer-hotfix-trace-flag-4199-servicing-model&quot; target=&quot;_blank&quot;&gt;SQL Server query optimizer hotfix trace flag 4199 servicing model&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;https://www.brentozar.com/archive/2016/03/sql-server-2016-death-trace-flag/&quot; target=&quot;_blank&quot;&gt;SQL Server 2016: The Death of the Trace Flag&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='https://mitch-wheat.blogspot.com/feeds/1304315109081985757/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/28468793/1304315109081985757' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/1304315109081985757'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/1304315109081985757'/><link rel='alternate' type='text/html' href='https://mitch-wheat.blogspot.com/2017/10/sql-server-have-bizare-poorly.html' title='SQL Server: Do You Have a Poorly Performing Query you can&#39;t Explain?'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</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-28468793.post-8689800835143416407</id><published>2017-10-03T12:57:00.002+08:00</published><updated>2017-10-03T12:57:53.147+08:00</updated><title type='text'>SQL Server 2017: Performance Improvements and Linux</title><content type='html'>&lt;br /&gt;
&lt;span style=&quot;background-color: white; border: 0px; box-sizing: inherit; color: #454545; font-family: &amp;quot;Segoe UI&amp;quot;, SegoeUI, tahoma, sans-serif; font-size: 14px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Bob Ward&#39;s post has some interesting stuff in it:&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;-webkit-font-smoothing: antialiased; background-color: white; border: 0px; box-sizing: inherit; color: #454545; font-family: WOL_Reg, &amp;quot;Segoe UI&amp;quot;, Tahoma, Arial, sans-serif; font-feature-settings: &#39;kern&#39; 1; font-weight: inherit; line-height: 1.25; margin: 0px 15.8906px 8px 0px; outline: 0px; padding: 0px; vertical-align: baseline; width: 717.172px; word-break: keep-all; word-wrap: break-word;&quot;&gt;
&lt;a href=&quot;https://blogs.technet.microsoft.com/dataplatforminsider/2017/09/27/sql-server-2017-fast-faster-and-the-fastest-database-everywhere-you-need-it/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;SQL Server 2017: Fast, faster, and the fastest database everywhere you need it&lt;/a&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='https://mitch-wheat.blogspot.com/feeds/8689800835143416407/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/28468793/8689800835143416407' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/8689800835143416407'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/8689800835143416407'/><link rel='alternate' type='text/html' href='https://mitch-wheat.blogspot.com/2017/10/sql-server-2017-performance.html' title='SQL Server 2017: Performance Improvements and Linux'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</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-28468793.post-2753850988991741294</id><published>2017-09-17T08:55:00.001+08:00</published><updated>2017-09-17T08:55:48.241+08:00</updated><title type='text'>SQL Server Connectivity Issues: Guided Walkthrough</title><content type='html'>&lt;p&gt;It’s not uncommon to see questions on StackOverflow relating to SQL Server connectivity issues. Microsoft support have published the following guide to help troubleshoot connectivity issues:&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;https://support.microsoft.com/en-us/help/4009936/solving-connectivity-errors-to-sql-server&quot;&gt;Solving Connectivity errors to SQL Server&lt;/a&gt;&lt;/p&gt;&lt;p&gt;In addition to providing a checklist of items that you can go through, it provides step by step troubleshooting procedures for the following error messages:&lt;ul&gt;&lt;li&gt;A network-related or instance-specific error occurred while establishing a connection to SQL Server
&lt;li&gt;No connection could be made because the target machine actively refused it
&lt;li&gt;SQL Server does not exist or access denied
&lt;li&gt;PivotTable Operation Failed: We cannot locate a server to load the workbook Data Model
&lt;li&gt;Cannot generate SSPI context
&lt;li&gt;Login failed for user
&lt;li&gt;Timeout Expired
&lt;li&gt;The timeout period elapsed prior to obtaining a connection from the pool&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;There are also troubleshooting guides for Always On and SQL Azure DB connectivity issues:&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;https://support.microsoft.com/en-us/help/10179/troubleshooting-alwayson-issues&quot;&gt;Troubleshooting Always On Issues&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;https://support.microsoft.com/en-in/help/10085/troubleshooting-connectivity-issues-with-microsoft-azure-sql-database&quot;&gt;Troubleshooting connectivity issues with Microsoft Azure SQL Database&lt;/a&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='https://mitch-wheat.blogspot.com/feeds/2753850988991741294/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/28468793/2753850988991741294' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/2753850988991741294'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/2753850988991741294'/><link rel='alternate' type='text/html' href='https://mitch-wheat.blogspot.com/2017/09/sql-server-connectivity-issues-guided.html' title='SQL Server Connectivity Issues: Guided Walkthrough'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</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-28468793.post-3420409098531904734</id><published>2016-12-27T15:54:00.001+08:00</published><updated>2016-12-27T15:54:42.797+08:00</updated><title type='text'>R: Evaluating a classifier using standard performance evaluation metrics</title><content type='html'>&lt;p&gt;The Azure ML team have released a useful &lt;a href=&quot;https://gallery.cortanaintelligence.com/Experiment/Custom-R-Evaluator-2&quot;&gt;Custom R Evaluator&lt;/a&gt; script for computing standard classifier performance metrics. The module expects as input a dataset containing the actual and predicted class labels (i.e. a confusion matrix). The R code is available at &lt;a href=&quot;https://github.com/saidbleik/Evaluation&quot;&gt;GitHub&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;Example output:&lt;pre&gt;$ConfusionMatrix
      Predicted
Actual  a  b  c
     a 27  2  5
     b  1 24  2
     c  1  5 33

$Metrics
                                     a         b         c
Accuracy                     0.8400000 0.8400000 0.8400000
Precision                    0.9310345 0.7741935 0.8250000
Recall                       0.7941176 0.8888889 0.8461538
F1                           0.8571429 0.8275862 0.8354430
MacroAvgPrecision            0.8434093 0.8434093 0.8434093
MacroAvgRecall               0.8430535 0.8430535 0.8430535
MacroAvgF1                   0.8400574 0.8400574 0.8400574
AvgAccuracy                  0.8933333 0.8933333 0.8933333
MicroAvgPrecision            0.8400000 0.8400000 0.8400000
MicroAvgRecall               0.8400000 0.8400000 0.8400000
MicroAvgF1                   0.8400000 0.8400000 0.8400000
MajorityClassAccuracy        0.3900000 0.3900000 0.3900000
MajorityClassPrecision       0.0000000 0.0000000 0.3900000
MajorityClassRecall          0.0000000 0.0000000 1.0000000
MajorityClassF1              0.0000000 0.0000000 0.5611511
Kappa                        0.7581986 0.7581986 0.7581986
RandomGuessAccuracy          0.3333333 0.3333333 0.3333333
RandomGuessPrecision         0.3400000 0.2700000 0.3900000
RandomGuessRecall            0.3333333 0.3333333 0.3333333
RandomGuessF1                0.3366337 0.2983425 0.3594470
RandomWeightedGuessAccuracy  0.3406000 0.3406000 0.3406000
RandomWeightedGuessPrecision 0.3400000 0.2700000 0.3900000
RandomWeightedGuessRecall    0.3400000 0.2700000 0.3900000
RandomWeightedGuessF1        0.3400000 0.2700000 0.3900000&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='https://mitch-wheat.blogspot.com/feeds/3420409098531904734/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/28468793/3420409098531904734' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/3420409098531904734'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/3420409098531904734'/><link rel='alternate' type='text/html' href='https://mitch-wheat.blogspot.com/2016/12/r-evaluating-classifier-using-standard.html' title='R: Evaluating a classifier using standard performance evaluation metrics'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</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-28468793.post-4107306146649419842</id><published>2016-12-21T13:14:00.001+08:00</published><updated>2016-12-21T13:15:33.919+08:00</updated><title type='text'>Editions and Supported Features for SQL Server 2016</title><content type='html'>&lt;p&gt;Just posting this link so I can find it easily: &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/cc645993.aspx&quot;&gt;Editions and Supported Features for SQL Server 2016&lt;/a&gt;&lt;/p&gt; &lt;p&gt; SQL Server 2016 SP1 onwards now supports Data Compression in Standard Edition (every edition in fact, including Express!)&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='https://mitch-wheat.blogspot.com/feeds/4107306146649419842/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/28468793/4107306146649419842' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/4107306146649419842'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/4107306146649419842'/><link rel='alternate' type='text/html' href='https://mitch-wheat.blogspot.com/2016/12/editions-and-supported-features-for-sql.html' title='Editions and Supported Features for SQL Server 2016'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</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-28468793.post-5729092010947636876</id><published>2016-11-30T09:31:00.000+08:00</published><updated>2017-09-04T12:07:31.830+08:00</updated><title type='text'>Storage Benchmarking with diskspd plus a LINQPad Script for Generating diskspd Batch Scripts</title><content type='html'>It is always a good idea to measure a performance baseline when commissioning (or choosing) new storage hardware or a new server, particularly for SQL Server. It is not uncommon for SAN’s to be non-optimally configured, so knowing how close the storage’s performance comes to the vendor’s advertised numbers is important. You should also benchmark when you make any hardware/configuration changes to storage.&lt;br /&gt;
&lt;br /&gt;
In the past, SQLIO was one of the commonly used tools to perform I/O testing, but SQLIO has now been superceded. &lt;code&gt;diskspd.exe&lt;/code&gt; is Microsoft’s replacement for SQLIO, with a more comprehensive set of testing features and expanded output. Like SQLIO, Diskspd is also a command line tool which means it can easily be scripted to perform reads and writes of various I/O block sizes including random and sequential access patterns to simulate different types of workloads.&lt;br /&gt;
&lt;h4&gt;
Where can I download &lt;code&gt;diskspd&lt;/code&gt;?&lt;/h4&gt;
&lt;code&gt;diskspd&lt;/code&gt; is stand-alone executable with no dependencies required to run it. You can download &lt;code&gt;diskspd&lt;/code&gt; from Microsoft TechNet – &lt;a href=&quot;https://gallery.technet.microsoft.com/DiskSpd-a-robust-storage-6cd2f223&quot;&gt;Diskspd, a Robust Storage Testing Tool&lt;/a&gt;.&lt;br /&gt;
Download the executable and unzip it into an appropriate folder. Once unzipped you will see 3 subfolders with different executable targets: &lt;strong&gt;amd64fre&lt;/strong&gt; (for 64-bit systems: the most common server target), x86fre (for 32-bit systems) and armfre (for ARM systems). The source code is hosted on Github &lt;a href=&quot;https://github.com/Microsoft/diskspd&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
Analyzing I/O Performance: What Metrics should I measure?&lt;/h2&gt;
The three main characteristics that are used to describe storage performance are (from Glenn Berry’s post: &lt;a href=&quot;https://sqlperformance.com/2015/05/io-subsystem/analyzing-io-performance-for-sql-server&quot;&gt;Analyzing I/O Performance for SQL Server&lt;/a&gt;):&lt;br /&gt;
&lt;h4&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; id=&quot;Latency_14&quot;&gt;&lt;/a&gt;Latency&lt;/h4&gt;
&lt;blockquote&gt;
Latency is the duration between issuing a request and receiving the response. The measurement begins when the operating system sends a request to the storage and ends when the storage completes the request. Reads are complete when the operating system receives the data; writes are complete when the drive signals the operating system that it has received the data.&lt;br /&gt;
For writes, the data may still be in a cache on the drive or disk controller, depending on your caching policy and hardware. &lt;strong&gt;Write-back caching is much faster than write-through caching, but it requires a battery backup for the disk controller&lt;/strong&gt;. For SQL Server usage, you want to make sure you are using write-back caching rather than write-through caching if at all possible. You also want to make sure your hardware disk cache is actually enabled: some vendor disk management tools disable it by default.&lt;/blockquote&gt;
&lt;h4&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; id=&quot;IOPS_InputOutput_Operations_per_Second__18&quot;&gt;&lt;/a&gt;IOPS (Input/Output Operations per Second )&lt;/h4&gt;
&lt;blockquote&gt;
The second metric is Input/Output Operations per Second (IOPS). A constant latency of 1ms means that a drive can process 1,000 IOs per second with a queue depth of 1. As more IOs are added to the queue, latency will increase. One of the key advantages of flash storage is that it can read/write to multiple NAND channels in parallel, along with the fact that there are no electro-mechanical moving parts to slow disk access down. IOPS actually equals queue depth divided by the latency, and IOPS by itself does not consider the transfer size for an individual disk transfer. &lt;strong&gt;You can translate IOPS to MB/sec and MB/sec to latency as long as you know the queue depth and transfer size&lt;/strong&gt;.&lt;/blockquote&gt;
The majority of storage vendors report their IOPS performance using a 4k block size, which is largely irrelevant for SQL Server workloads, since the majority of the time SQL Server reads data in 64k chunks. &lt;a href=&quot;https://www.brentozar.com/archive/2013/09/iops-are-a-scam/&quot;&gt;IOPS Are A Scam&lt;/a&gt;. To convert 4k block IOPS into 64k block IOPS simply divide by 16 or to convert IOPS into MB/s measurements multiply IOPS * block transfer size.&lt;br /&gt;
&lt;h4&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; id=&quot;Throughput_23&quot;&gt;&lt;/a&gt;Throughput&lt;/h4&gt;
&lt;blockquote&gt;
Sequential throughput is the rate that you can transfer data, typically measured in megabytes per second (MB/sec) or gigabytes per second (GB/sec). Your sequential throughput metric in MB/sec equals the IOPS times the transfer size. For example, 556 MB/sec equals 135,759 IOPS times a 4096 bytes transfer size, while 135,759 IOPS times a 8192 bytes transfer size would be 1112 MB/sec of sequential throughput. Despite its everyday importance to SQL Server, sequential disk throughput often gets short-changed in enterprise storage, both by storage vendors and by storage administrators. It is also actually fairly common to see the actual magnetic disks in a direct attached storage (DAS) enclosure or a storage area network (SAN) device be so busy that they cannot deliver their full rated sequential throughput.&lt;/blockquote&gt;
&lt;blockquote&gt;
Sequential throughput is critical for many common database server activities, including full database backups and restores, index creation and rebuilds, and large data warehouse-type sequential read scans (when your data does not fit into the SQL Server buffer pool).&lt;/blockquote&gt;
&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; id=&quot;How_do_I_use_diskspd_28&quot;&gt;&lt;/a&gt;How do I use diskspd?&lt;/h2&gt;
&lt;strong&gt;WARNING&lt;/strong&gt;:&amp;nbsp;Ideally, you should perform DskSpd testing when there is no other activity on the server and storage. You could be generating a large amount of disk IO, network traffic and/or CPU load when you run DiskSpd. If you’re in a shared environment, you might want to talk to your administrator(s) before running such a test. &lt;strong&gt;This could negatively impact anyone else using other VMs in the same host, other LUNs on the same SAN or other traffic on the same network.&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;
Ensure the user used to run diskspd has been granted the ‘Perform volume maintenance tasks’ right: run secpol.msc -&amp;amp;&amp;gt;; Local Policies -&amp;gt; User Rights Assignment -&amp;gt; ‘Perform volume maintenance tasks’&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;NOTE&lt;/strong&gt;: You should run diskspd from an elevated command prompt (by choosing “Run as Administrator”). This will ensure file creation is fast. Otherwise, diskspd will fall back to a slower method of creating files.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
diskpsd parameters&lt;/h3&gt;
You can get a complete list of all the supported command line parameters and usage by entering the following at a command prompt:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;&amp;gt; diskspd.exe
&lt;/code&gt;&lt;/pre&gt;
The most common parameters are:&lt;br /&gt;
&lt;table class=&quot;table table-striped table-bordered&quot; style=&quot;color: black;&quot;&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Parameter&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;-d&lt;/td&gt;
&lt;td&gt;Test duration in seconds. Aim for at least 60 seconds&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-W&lt;/td&gt;
&lt;td&gt;Test warm up time in seconds&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-b&lt;/td&gt;
&lt;td&gt;I/O Block size (K/M/G). e.g. –b8K means an 8KB block size, -b64K means a 64KB block size: both are relevant for SQL Server&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-o&lt;/td&gt;
&lt;td&gt;Number of outstanding I/Os (queue depth) per target, per worker thread&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-t&lt;/td&gt;
&lt;td&gt;Worker threads per test file&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-Su&lt;/td&gt;
&lt;td&gt;Disable software caching&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-Sw&lt;/td&gt;
&lt;td&gt;Enable writethrough (no hardware write caching). Normally used together (-Suw) to replace deprecated -h (or equivently use -Sh)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-L&lt;/td&gt;
&lt;td&gt;Capture latency info&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-r&lt;/td&gt;
&lt;td&gt;Random data access tests&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-si&lt;/td&gt;
&lt;td&gt;Thread coordinated Sequential data access tests&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-w&lt;/td&gt;
&lt;td&gt;Write percentage. For example, –w10 means 10% writes, 90% reads&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-Z&amp;lt;size&amp;gt;[K|M|G|b]&lt;/td&gt;
&lt;td&gt;Workload test write source buffer size. Used to supply random data (entropy) for writes, which is a good idea for SQL Server testing and for testing de-duping behaviour on flash arrays&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-c&amp;lt;size&amp;gt;[K|M|G|b]&lt;/td&gt;
&lt;td&gt;Create workload file(s) of specified size&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
e.g:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;diskspd.exe -Suw -L -W5 –Z1G -d60 –c440G -t8 -o4 -b8K -r -w20 E:\iotest.dat &amp;gt; output.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
This will run a 60 second random I/O test using a 440GB test file located on the E: drive, with a 20% write and 80% read ratio, using an 8K block size and a 5 second warm up. It will use eight worker threads, each with four outstanding I/Os and a write entropy buffer of 1GB, and save the results to a text file named output.txt. This set of parameters is representative of a SQL Server OLTP workload.&lt;br /&gt;
&lt;strong&gt;Note&lt;/strong&gt;: The test file size (you can have multiple test files) should be larger than the SAN’s DRAM cache (and ideally not an exact multiple of it).&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; id=&quot;LINQPad_Script_69&quot;&gt;&lt;/a&gt;LINQPad Script&lt;/h2&gt;
To automate the creation of a bunch of testing scenarios, rather than manually editing (which is tedious and error prone), I’ve written a simple C# LINQPad script:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;code class=&quot;language-csharp&quot;&gt;  &lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-csharp&quot;&gt;&lt;span class=&quot;hljs-comment&quot;&gt;  const string batchScriptFilename = @&quot;c:\temp\diskspd.bat&quot;;

  // Flags used in each run and do not vary
  string disableHardwarecaching = &quot;-Suw&quot;;       // -Suw: Disable both hardware and software buffering. SQL Server does this.
                                                // Su = disable software caching, Sw = enable writethrough (no hardware write caching)
  string captureLatency    = &quot;-L&quot;;              // capture disk latency numbers
  string warmWorkLoad      = &quot;-W5&quot;;             // Warm up time in seconds
  string entropyRandomData = &quot;-Z1G&quot;;            // Used to supply random data (K/M/G) for writes, which is good for SQL Server testing.
  string testduration      = &quot;-d120&quot;;           // Test duration in seconds NB: At least 60 seconds, 2-3 minutes is good 
  string testFileSize      = &quot;-c440G&quot;;          // Nothing smaller than the SAN&#39;s cache size (and not an exact multiple of it)
  string testFileFullPath  = @&quot;E:\iotest.dat&quot;;  // Test file name (goes at the end of the command)
  string resultsFilename   = @&quot;output.txt&quot;;     // File to output the text results&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-csharp&quot;&gt;&lt;span class=&quot;hljs-comment&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-csharp&quot;&gt;&lt;span class=&quot;hljs-comment&quot;&gt;  // prefix results file name with date&lt;/span&gt;
  resultsFilename = DateTime.Now.Date.ToString(&lt;span class=&quot;hljs-string&quot;&gt;&quot;yyyyMMdd&quot;&lt;/span&gt;) + &lt;span class=&quot;hljs-string&quot;&gt;&quot;_&quot;&lt;/span&gt; + resultsFilename;
  
  &lt;span class=&quot;hljs-comment&quot;&gt;// Lists of varying params to use&lt;/span&gt;
  &lt;span class=&quot;hljs-keyword&quot;&gt;var&lt;/span&gt; randomOrSequential = &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; List&amp;lt;&lt;span class=&quot;hljs-keyword&quot;&gt;string&lt;/span&gt;&amp;gt; { &lt;span class=&quot;hljs-string&quot;&gt;&quot;-r&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot;&gt;&quot;-si&quot;&lt;/span&gt; };                 &lt;span class=&quot;hljs-comment&quot;&gt;// -r = Random, -si = Sequential&lt;/span&gt;
  &lt;span class=&quot;hljs-keyword&quot;&gt;var&lt;/span&gt; writepercentage = &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; List&amp;lt;&lt;span class=&quot;hljs-keyword&quot;&gt;string&lt;/span&gt;&amp;gt; { &lt;span class=&quot;hljs-string&quot;&gt;&quot;-w0&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot;&gt;&quot;-w10&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot;&gt;&quot;-w25&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot;&gt;&quot;-w100&quot;&lt;/span&gt; }; &lt;span class=&quot;hljs-comment&quot;&gt;// -w0 means no writes: -w10 = 90%/10% reads/writes           &lt;/span&gt;
  &lt;span class=&quot;hljs-keyword&quot;&gt;var&lt;/span&gt; blocksize = &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; List&amp;lt;&lt;span class=&quot;hljs-keyword&quot;&gt;string&lt;/span&gt;&amp;gt; { &lt;span class=&quot;hljs-string&quot;&gt;&quot;-b8K&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot;&gt;&quot;-b64K&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot;&gt;&quot;-b512K&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot;&gt;&quot;-b2M&quot;&lt;/span&gt; };    &lt;span class=&quot;hljs-comment&quot;&gt;// 2M represents SQL Server read ahead, 512K backups&lt;/span&gt;
  &lt;span class=&quot;hljs-keyword&quot;&gt;var&lt;/span&gt; overlappedIOs = &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; List&amp;lt;&lt;span class=&quot;hljs-keyword&quot;&gt;string&lt;/span&gt;&amp;gt; { &lt;span class=&quot;hljs-string&quot;&gt;&quot;-o2&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot;&gt;&quot;-o4&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot;&gt;&quot;-o8&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot;&gt;&quot;-o16&quot;&lt;/span&gt;};       &lt;span class=&quot;hljs-comment&quot;&gt;// This is queue depth&lt;/span&gt;
  &lt;span class=&quot;hljs-keyword&quot;&gt;var&lt;/span&gt; workerthreads = &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; List&amp;lt;&lt;span class=&quot;hljs-keyword&quot;&gt;string&lt;/span&gt;&amp;gt; { &lt;span class=&quot;hljs-string&quot;&gt;&quot;-t4&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot;&gt;&quot;-t8&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot;&gt;&quot;-t16&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot;&gt;&quot;-t32&quot;&lt;/span&gt; };     &lt;span class=&quot;hljs-comment&quot;&gt;// Worker threads&lt;/span&gt;

  &lt;span class=&quot;hljs-keyword&quot;&gt;int&lt;/span&gt; runTimeSeconds = randomOrSequential.Count() * writepercentage.Count() * blocksize.Count() * 
                       overlappedIOs.Count() * workerthreads.Count() * 
                       (Int32.Parse(testduration.Substring(&lt;span class=&quot;hljs-number&quot;&gt;2&lt;/span&gt;)) + Int32.Parse(warmWorkLoad.Substring(&lt;span class=&quot;hljs-number&quot;&gt;2&lt;/span&gt;)));

  &lt;span class=&quot;hljs-keyword&quot;&gt;using&lt;/span&gt; (StreamWriter fs = &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; StreamWriter(batchScriptFilename))
  {
      fs.WriteLine(&lt;span class=&quot;hljs-string&quot;&gt;&quot;REM Expected run time: {0} Minutes == {1:0.0} Hours&quot;&lt;/span&gt;, runTimeSeconds / &lt;span class=&quot;hljs-number&quot;&gt;60&lt;/span&gt;, runTimeSeconds / &lt;span class=&quot;hljs-number&quot;&gt;3600.0&lt;/span&gt;);

      &lt;span class=&quot;hljs-keyword&quot;&gt;string&lt;/span&gt; cmd = &lt;span class=&quot;hljs-keyword&quot;&gt;string&lt;/span&gt;.Format(&lt;span class=&quot;hljs-string&quot;&gt;&quot;diskspd.exe {0} {1} {2} {3} {4} {5} &quot;&lt;/span&gt;,
                                 disableHardwarecaching, captureLatency, warmWorkLoad,
                                 entropyRandomData, testduration, testFileSize);
      &lt;span class=&quot;hljs-comment&quot;&gt;// Yes, LINQ could be used!&lt;/span&gt;
      &lt;span class=&quot;hljs-keyword&quot;&gt;for&lt;/span&gt; (&lt;span class=&quot;hljs-keyword&quot;&gt;int&lt;/span&gt; i1 = &lt;span class=&quot;hljs-number&quot;&gt;0&lt;/span&gt;; i1 &amp;lt; writepercentage.Count(); i1++)
      {
          &lt;span class=&quot;hljs-keyword&quot;&gt;for&lt;/span&gt; (&lt;span class=&quot;hljs-keyword&quot;&gt;int&lt;/span&gt; i2 = &lt;span class=&quot;hljs-number&quot;&gt;0&lt;/span&gt;; i2 &amp;lt; randomOrSequential.Count(); i2++)
          {
              &lt;span class=&quot;hljs-keyword&quot;&gt;for&lt;/span&gt; (&lt;span class=&quot;hljs-keyword&quot;&gt;int&lt;/span&gt; i3 = &lt;span class=&quot;hljs-number&quot;&gt;0&lt;/span&gt;; i3 &amp;lt; blocksize.Count(); i3++)
              {
                  &lt;span class=&quot;hljs-keyword&quot;&gt;for&lt;/span&gt; (&lt;span class=&quot;hljs-keyword&quot;&gt;int&lt;/span&gt; i4 = &lt;span class=&quot;hljs-number&quot;&gt;0&lt;/span&gt;; i4 &amp;lt; overlappedIOs.Count(); i4++)
                  {
                      &lt;span class=&quot;hljs-keyword&quot;&gt;for&lt;/span&gt; (&lt;span class=&quot;hljs-keyword&quot;&gt;int&lt;/span&gt; i5 = &lt;span class=&quot;hljs-number&quot;&gt;0&lt;/span&gt;; i5 &amp;lt; workerthreads.Count(); i5++)
                      {
                          fs.WriteLine(&lt;span class=&quot;hljs-keyword&quot;&gt;string&lt;/span&gt;.Format(&lt;span class=&quot;hljs-string&quot;&gt;&quot;{0} {1} {2} {3} {4} {5} {6} &amp;gt;&amp;gt; {7}&quot;&lt;/span&gt;,
                                              cmd,
                                              workerthreads[i5],
                                              overlappedIOs[i4],
                                              blocksize[i3],
                                              randomOrSequential[i2],
                                              writepercentage[i1],
                                              testFileFullPath,
                                              resultsFilename
                                            ));
                      }
                  }
                  fs.WriteLine(&lt;span class=&quot;hljs-string&quot;&gt;&quot;&quot;&lt;/span&gt;);
              }
              fs.WriteLine(&lt;span class=&quot;hljs-string&quot;&gt;&quot;&quot;&lt;/span&gt;);
          }
          fs.WriteLine(&lt;span class=&quot;hljs-string&quot;&gt;&quot;&quot;&lt;/span&gt;);
      }
  }
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; id=&quot;Short_Test_Batch_Script_127&quot;&gt;&lt;/a&gt;&amp;nbsp;&lt;/h2&gt;
&lt;h2&gt;
Short Test Batch Script&lt;/h2&gt;
A batch script to perform an initial (relatively) quick test would look something like the following:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;REM Expected run time: 98 Minutes == 1.6 Hours
diskspd.exe -Suw -L -W3 -Z1G -d120 -c440G  -t4 -o2 -b8K -r -w0 E:\iotest.dat &amp;gt;&amp;gt; output.txt
diskspd.exe -Suw -L -W3 -Z1G -d120 -c440G  -t8 -o2 -b8K -r -w0 E:\iotest.dat &amp;gt;&amp;gt; output.txt
diskspd.exe -Suw -L -W3 -Z1G -d120 -c440G  -t16 -o2 -b8K -r -w0 E:\iotest.dat &amp;gt;&amp;gt; output.txt
diskspd.exe -Suw -L -W3 -Z1G -d120 -c440G  -t4 -o4 -b8K -r -w0 E:\iotest.dat &amp;gt;&amp;gt; output.txt
diskspd.exe -Suw -L -W3 -Z1G -d120 -c440G  -t8 -o4 -b8K -r -w0 E:\iotest.dat &amp;gt;&amp;gt; output.txt
diskspd.exe -Suw -L -W3 -Z1G -d120 -c440G  -t16 -o4 -b8K -r -w0 E:\iotest.dat &amp;gt;&amp;gt; output.txt
diskspd.exe -Suw -L -W3 -Z1G -d120 -c440G  -t4 -o8 -b8K -r -w0 E:\iotest.dat &amp;gt;&amp;gt; output.txt
diskspd.exe -Suw -L -W3 -Z1G -d120 -c440G  -t8 -o8 -b8K -r -w0 E:\iotest.dat &amp;gt;&amp;gt; output.txt
diskspd.exe -Suw -L -W3 -Z1G -d120 -c440G  -t16 -o8 -b8K -r -w0 E:\iotest.dat &amp;gt;&amp;gt; output.txt
diskspd.exe -Suw -L -W3 -Z1G -d120 -c440G  -t4 -o16 -b8K -r -w0 E:\iotest.dat &amp;gt;&amp;gt; output.txt
diskspd.exe -Suw -L -W3 -Z1G -d120 -c440G  -t8 -o16 -b8K -r -w0 E:\iotest.dat &amp;gt;&amp;gt; output.txt
diskspd.exe -Suw -L -W3 -Z1G -d120 -c440G  -t16 -o16 -b8K -r -w0 E:\iotest.dat &amp;gt;&amp;gt; output.txt

diskspd.exe -Suw -L -W3 -Z1G -d120 -c440G  -t4 -o2 -b64K -r -w0 E:\iotest.dat &amp;gt;&amp;gt; output.txt
diskspd.exe -Suw -L -W3 -Z1G -d120 -c440G  -t8 -o2 -b64K -r -w0 E:\iotest.dat &amp;gt;&amp;gt; output.txt
diskspd.exe -Suw -L -W3 -Z1G -d120 -c440G  -t16 -o2 -b64K -r -w0 E:\iotest.dat &amp;gt;&amp;gt; output.txt
diskspd.exe -Suw -L -W3 -Z1G -d120 -c440G  -t4 -o4 -b64K -r -w0 E:\iotest.dat &amp;gt;&amp;gt; output.txt
diskspd.exe -Suw -L -W3 -Z1G -d120 -c440G  -t8 -o4 -b64K -r -w0 E:\iotest.dat &amp;gt;&amp;gt; output.txt
diskspd.exe -Suw -L -W3 -Z1G -d120 -c440G  -t16 -o4 -b64K -r -w0 E:\iotest.dat &amp;gt;&amp;gt; output.txt
diskspd.exe -Suw -L -W3 -Z1G -d120 -c440G  -t4 -o8 -b64K -r -w0 E:\iotest.dat &amp;gt;&amp;gt; output.txt
diskspd.exe -Suw -L -W3 -Z1G -d120 -c440G  -t8 -o8 -b64K -r -w0 E:\iotest.dat &amp;gt;&amp;gt; output.txt
diskspd.exe -Suw -L -W3 -Z1G -d120 -c440G  -t16 -o8 -b64K -r -w0 E:\iotest.dat &amp;gt;&amp;gt; output.txt
diskspd.exe -Suw -L -W3 -Z1G -d120 -c440G  -t4 -o16 -b64K -r -w0 E:\iotest.dat &amp;gt;&amp;gt; output.txt
diskspd.exe -Suw -L -W3 -Z1G -d120 -c440G  -t8 -o16 -b64K -r -w0 E:\iotest.dat &amp;gt;&amp;gt; output.txt
diskspd.exe -Suw -L -W3 -Z1G -d120 -c440G  -t16 -o16 -b64K -r -w0 E:\iotest.dat &amp;gt;&amp;gt; output.txt

diskspd.exe -Suw -L -W3 -Z1G -d120 -c440G  -t4 -o2 -b8K -r -w20 E:\iotest.dat &amp;gt;&amp;gt; output.txt
diskspd.exe -Suw -L -W3 -Z1G -d120 -c440G  -t8 -o2 -b8K -r -w20 E:\iotest.dat &amp;gt;&amp;gt; output.txt
diskspd.exe -Suw -L -W3 -Z1G -d120 -c440G  -t16 -o2 -b8K -r -w20 E:\iotest.dat &amp;gt;&amp;gt; output.txt
diskspd.exe -Suw -L -W3 -Z1G -d120 -c440G  -t4 -o4 -b8K -r -w20 E:\iotest.dat &amp;gt;&amp;gt; output.txt
diskspd.exe -Suw -L -W3 -Z1G -d120 -c440G  -t8 -o4 -b8K -r -w20 E:\iotest.dat &amp;gt;&amp;gt; output.txt
diskspd.exe -Suw -L -W3 -Z1G -d120 -c440G  -t16 -o4 -b8K -r -w20 E:\iotest.dat &amp;gt;&amp;gt; output.txt
diskspd.exe -Suw -L -W3 -Z1G -d120 -c440G  -t4 -o8 -b8K -r -w20 E:\iotest.dat &amp;gt;&amp;gt; output.txt
diskspd.exe -Suw -L -W3 -Z1G -d120 -c440G  -t8 -o8 -b8K -r -w20 E:\iotest.dat &amp;gt;&amp;gt; output.txt
diskspd.exe -Suw -L -W3 -Z1G -d120 -c440G  -t16 -o8 -b8K -r -w20 E:\iotest.dat &amp;gt;&amp;gt; output.txt
diskspd.exe -Suw -L -W3 -Z1G -d120 -c440G  -t4 -o16 -b8K -r -w20 E:\iotest.dat &amp;gt;&amp;gt; output.txt
diskspd.exe -Suw -L -W3 -Z1G -d120 -c440G  -t8 -o16 -b8K -r -w20 E:\iotest.dat &amp;gt;&amp;gt; output.txt
diskspd.exe -Suw -L -W3 -Z1G -d120 -c440G  -t16 -o16 -b8K -r -w20 E:\iotest.dat &amp;gt;&amp;gt; output.txt

diskspd.exe -Suw -L -W3 -Z1G -d120 -c440G  -t4 -o2 -b64K -r -w20 E:\iotest.dat &amp;gt;&amp;gt; output.txt
diskspd.exe -Suw -L -W3 -Z1G -d120 -c440G  -t8 -o2 -b64K -r -w20 E:\iotest.dat &amp;gt;&amp;gt; output.txt
diskspd.exe -Suw -L -W3 -Z1G -d120 -c440G  -t16 -o2 -b64K -r -w20 E:\iotest.dat &amp;gt;&amp;gt; output.txt
diskspd.exe -Suw -L -W3 -Z1G -d120 -c440G  -t4 -o4 -b64K -r -w20 E:\iotest.dat &amp;gt;&amp;gt; output.txt
diskspd.exe -Suw -L -W3 -Z1G -d120 -c440G  -t8 -o4 -b64K -r -w20 E:\iotest.dat &amp;gt;&amp;gt; output.txt
diskspd.exe -Suw -L -W3 -Z1G -d120 -c440G  -t16 -o4 -b64K -r -w20 E:\iotest.dat &amp;gt;&amp;gt; output.txt
diskspd.exe -Suw -L -W3 -Z1G -d120 -c440G  -t4 -o8 -b64K -r -w20 E:\iotest.dat &amp;gt;&amp;gt; output.txt
diskspd.exe -Suw -L -W3 -Z1G -d120 -c440G  -t8 -o8 -b64K -r -w20 E:\iotest.dat &amp;gt;&amp;gt; output.txt
diskspd.exe -Suw -L -W3 -Z1G -d120 -c440G  -t16 -o8 -b64K -r -w20 E:\iotest.dat &amp;gt;&amp;gt; output.txt
diskspd.exe -Suw -L -W3 -Z1G -d120 -c440G  -t4 -o16 -b64K -r -w20 E:\iotest.dat &amp;gt;&amp;gt; output.txt
diskspd.exe -Suw -L -W3 -Z1G -d120 -c440G  -t8 -o16 -b64K -r -w20 E:\iotest.dat &amp;gt;&amp;gt; output.txt
diskspd.exe -Suw -L -W3 -Z1G -d120 -c440G  -t16 -o16 -b64K -r -w20 E:\iotest.dat &amp;gt;&amp;gt; output.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; id=&quot;Interpreting_the_diskspd_results_185&quot;&gt;&lt;/a&gt;&amp;nbsp;&lt;/h2&gt;
&lt;h2&gt;
Interpreting the diskspd results&lt;/h2&gt;
&lt;code&gt;diskspd&lt;/code&gt; produces quite a bit of output per run. The first section is a recap of the parameters that were used in the command line:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;Command Line: diskspd.exe -Suw -L -W5 -Z1G -d120 -c440G -t16 -o4 -b64K -r -w10 E:\iotest.dat

Input parameters:

    timespan:   1
    -------------
    duration: 120s
    warm up time: 5s
    cool down time: 0s
    measuring latency
    random seed: 0
    path: &#39;E:\iotest.dat&#39;
        think time: 0ms
        burst size: 0
        software cache disabled
        hardware write cache disabled, writethrough on
        write buffer size: 1073741824
        performing mix test (read/write ratio: 90/10)
        block size: 65536
        using random I/O (alignment: 65536)
        number of outstanding I/O operations: 4
        thread stride size: 0
        threads per file: 16
        using I/O Completion Ports
        IO priority: normal
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
This is a great improvement over &lt;code&gt;sqlio&lt;/code&gt; which did not echo the run parameters or provide a readable summary of the parameters, making it hard to decipher runs at a later date.&lt;br /&gt;
Next is a summary of CPU information. This information can help determine if your storage test is CPU bottlenecked:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;actual test time:   120.00s
thread count:       16
proc count:     32

CPU |  Usage |  User  |  Kernel |  Idle
-------------------------------------------
   0|  10.21%|   1.09%|    9.11%|  89.79%
   1|  10.31%|   1.09%|    9.22%|  89.69%
   2|  10.14%|   1.08%|    9.06%|  89.86%
   3|  18.26%|   0.94%|   17.32%|  81.74%
   4|   7.86%|   1.12%|    6.74%|  92.14%
   5|   7.79%|   0.91%|    6.87%|  92.21%
   6|   7.55%|   1.15%|    6.41%|  92.45%
   7|   7.71%|   1.13%|    6.58%|  92.29%
   8|   0.00%|   0.00%|    0.00%|   0.00%
 ...
-------------------------------------------
avg.|   2.49%|   0.27%|    2.23%|  22.51%
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
The results for each thread should be very similar in most cases.&lt;br /&gt;
After the CPU summary is the I/O summary, split into total (read + write), followed by separate read and write statistics:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;Total IO
thread |       bytes     |     I/Os     |     MB/s   |  I/O per s |  AvgLat  | LatStdDev |  file
-----------------------------------------------------------------------------------------------------
     0 |     10107486208 |       154228 |      80.33 |    1285.23 |    3.109 |     3.640 | E:\iotest.dat (440GB)
     1 |     10038870016 |       153181 |      79.78 |    1276.50 |    3.130 |     4.082 | E:\iotest.dat (440GB)
     2 |     10062594048 |       153543 |      79.97 |    1279.52 |    3.123 |     4.048 | E:\iotest.dat (440GB)
     3 |     10012590080 |       152780 |      79.57 |    1273.16 |    3.138 |     3.954 | E:\iotest.dat (440GB)
     4 |     10169417728 |       155173 |      80.82 |    1293.10 |    3.090 |     3.909 | E:\iotest.dat (440GB)
     5 |     10148446208 |       154853 |      80.65 |    1290.44 |    3.096 |     4.159 | E:\iotest.dat (440GB)
     6 |     10158669824 |       155009 |      80.73 |    1291.74 |    3.093 |     4.024 | E:\iotest.dat (440GB)
     7 |     10205724672 |       155727 |      81.11 |    1297.72 |    3.079 |     3.901 | E:\iotest.dat (440GB)
     8 |     10096607232 |       154062 |      80.24 |    1283.85 |    3.112 |     3.896 | E:\iotest.dat (440GB)
     9 |     10057023488 |       153458 |      79.93 |    1278.81 |    3.124 |     4.187 | E:\iotest.dat (440GB)
    10 |     10092347392 |       153997 |      80.21 |    1283.30 |    3.113 |     3.951 | E:\iotest.dat (440GB)
    11 |      9996730368 |       152538 |      79.45 |    1271.15 |    3.143 |     3.894 | E:\iotest.dat (440GB)
    12 |     10157883392 |       154997 |      80.73 |    1291.64 |    3.093 |     4.040 | E:\iotest.dat (440GB)
    13 |     10157424640 |       154990 |      80.72 |    1291.58 |    3.093 |     3.934 | E:\iotest.dat (440GB)
    14 |     10177937408 |       155303 |      80.89 |    1294.19 |    3.087 |     3.978 | E:\iotest.dat (440GB)
    15 |     10223681536 |       156001 |      81.25 |    1300.00 |    3.073 |     3.642 | E:\iotest.dat (440GB)
-----------------------------------------------------------------------------------------------------
total:      161863434240 |      2469840 |    1286.37 |   20581.94 |    3.106 |     3.955
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;strong&gt;Remember&lt;/strong&gt;: The I/Os are recorded in whatever blocksize the test specified. In the case above, the I/Os are 64K I/Os.&lt;br /&gt;
Last, but not least are the latency measurements:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;  %-ile |  Read (ms) | Write (ms) | Total (ms)
----------------------------------------------
    min |      0.535 |      0.729 |      0.535
   25th |      2.531 |      3.446 |      2.565
   50th |      2.796 |      3.792 |      2.849
   75th |      3.088 |      4.227 |      3.211
   90th |      3.439 |      4.743 |      3.745
   95th |      3.763 |      5.179 |      4.169
   99th |      4.818 |      6.761 |      5.274
3-nines |     38.694 |     42.926 |     39.374
4-nines |    207.585 |    209.483 |    207.734
5-nines |    208.562 |    210.939 |    209.483
6-nines |    209.058 |    211.330 |    210.939
7-nines |    209.256 |    211.330 |    211.330
8-nines |    209.256 |    211.330 |    211.330
9-nines |    209.256 |    211.330 |    211.330
    max |    209.256 |    211.330 |    211.330
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
This last section shows the latency percentile distribution of the test results from the minimum to the maximum value in milliseconds, split into reads, writes and total latency. It’s essential to know how the storage will perform and respond under load, so this section should examined carefully. The “n-nines” in the ‘%-ile’ column refers to the number of nines, where 3-nines means 99.9%, 4-nines means 99.99% etc. If you want to accurately measure the higher percentiles, you should run longer duration tests that generate a larger number of I/O operations.&lt;br /&gt;
&lt;strong&gt;What you want to look for in the latency results is the point at which the values make a large jump&lt;/strong&gt;. In this test, 99% of the reads had a latency of 4.818 milliseconds or less, but if we go higher, 99.9% of the reads had a latency of 38.694 milliseconds or less.</content><link rel='replies' type='application/atom+xml' href='https://mitch-wheat.blogspot.com/feeds/5729092010947636876/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/28468793/5729092010947636876' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/5729092010947636876'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/5729092010947636876'/><link rel='alternate' type='text/html' href='https://mitch-wheat.blogspot.com/2016/11/storage-benchmarking-with-diskspd-plus.html' title='Storage Benchmarking with diskspd plus a LINQPad Script for Generating diskspd Batch Scripts'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</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-28468793.post-1846115092951342774</id><published>2016-06-16T14:48:00.001+08:00</published><updated>2016-06-16T14:48:24.438+08:00</updated><title type='text'>SQL Server: Create a linked server from an on-premise SQL Server* to SQL Azure</title><content type='html'>&lt;p&gt;* SQL Server 2008 onwards&lt;/p&gt; &lt;p&gt;The use of SQL Server’s &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/ms190479.aspx&quot;&gt;sp_addlinkedserver&lt;/a&gt; can be a little arcane. I recently needed to connect from an on-premise SQL Server to SQL Azure for the purpose of querying and downloading data to a reporting server, and there a couple of things to note.&lt;/p&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;One is that you should ensure that data is encrypted on the wire (* and also when connecting to remote servers from SSMS).&lt;/p&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;&amp;nbsp;&lt;/p&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;The other is that you have to may specify the server name as a DNS name (depending on the client connection library you are using). This is the case if you receive this error message:&lt;/p&gt; &lt;blockquote&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;“&lt;em&gt;Server name cannot be determined.&amp;nbsp; It must appear as the first segment of the server&#39;s dns name (&lt;strong&gt;servername.database.windows.net&lt;/strong&gt;).&amp;nbsp; Some libraries do not send the server name, in which case the server name must be included as part of the user name (username@servername).&amp;nbsp; In addition, if both formats are used, the server names must match&lt;/em&gt;. “&lt;/p&gt;&lt;/blockquote&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;Here’s the working TSQL script I used:&lt;/p&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;&lt;span style=&quot;font-family: ; color: &quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-family: ; color: &quot;&gt;&lt;font color=&quot;#008000&quot; face=&quot;Consolas&quot;&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;&lt;span style=&quot;font-family: ; color: &quot;&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot; color=&quot;#008000&quot;&gt;-- If linked server already exists, drop it and any associated logins.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &quot;&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;span style=&quot;font-family: ; color: &quot;&gt;&lt;font color=&quot;#0000ff&quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot;&gt;begin&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot;&gt; &lt;/font&gt;&lt;span style=&quot;color: &quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot; color=&quot;#0000ff&quot;&gt;try&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;&lt;span style=&quot;font-family: &quot;&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;span style=&quot;mso-spacerun: yes&quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;font style=&quot;font-size: 9.5pt&quot;&gt;&lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#0000ff&quot;&gt;exec&lt;/font&gt;&lt;/span&gt; &lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#800000&quot;&gt;sp_dropserver&lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#0000ff&quot;&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#ff0000&quot;&gt;&#39;LocalLinkedServername&#39;&lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#808080&quot;&gt;,&lt;/font&gt;&lt;/span&gt; &lt;/font&gt;&lt;span style=&quot;color: &quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot; color=&quot;#ff0000&quot;&gt;&#39;droplogins&#39;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;span style=&quot;font-family: ; color: &quot;&gt;&lt;font color=&quot;#0000ff&quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot;&gt;end&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot;&gt; &lt;/font&gt;&lt;span style=&quot;color: &quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot; color=&quot;#0000ff&quot;&gt;try&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;span style=&quot;font-family: ; color: &quot;&gt;&lt;font color=&quot;#0000ff&quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot;&gt;begin&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot;&gt; &lt;/font&gt;&lt;span style=&quot;color: &quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot; color=&quot;#0000ff&quot;&gt;catch&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;span style=&quot;font-family: ; color: &quot;&gt;&lt;font color=&quot;#0000ff&quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot;&gt;end&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot;&gt; &lt;/font&gt;&lt;span style=&quot;color: &quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot; color=&quot;#0000ff&quot;&gt;catch&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;&lt;span style=&quot;font-family: &quot;&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot;&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;&lt;span style=&quot;font-family: &quot;&gt;&lt;font color=&quot;#008080&quot; face=&quot;Consolas&quot;&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &quot;&gt;&lt;font style=&quot;color=#008000&quot; face=&quot;Consolas&quot;&gt;-- Create the linked server:&lt;/font&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &quot;&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;span style=&quot;font-family: ; color: &quot;&gt;&lt;font color=&quot;#0000ff&quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot;&gt;EXEC&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot;&gt; &lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#800000&quot;&gt;sp_addlinkedserver&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style=&quot;color: &quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot; color=&quot;#0000ff&quot;&gt; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;&lt;font color=&quot;#0000ff&quot; face=&quot;Consolas&quot;&gt;&lt;span style=&quot;font-family: &quot;&gt;&lt;span style=&quot;color: &quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style=&quot;font-family: &quot;&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot;&gt;@server&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#808080&quot;&gt;= &lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#ff0000&quot;&gt;&#39;LocalLinkedServername&#39;&lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#808080&quot;&gt;,&lt;/font&gt;&lt;/span&gt; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;&lt;span style=&quot;font-family: &quot;&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @srvproduct &lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#808080&quot;&gt;= &lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#ff0000&quot;&gt;N&#39;Any&#39;&lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#808080&quot;&gt;,&lt;/font&gt;&lt;/span&gt; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;&lt;span style=&quot;font-family: &quot;&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @provider&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#808080&quot;&gt;= &lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#ff0000&quot;&gt;&#39;SQLNCLI&#39;&lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#808080&quot;&gt;,&lt;/font&gt;&lt;/span&gt; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;&lt;span style=&quot;font-family: &quot;&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @datasrc&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#808080&quot;&gt;= &lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#ff0000&quot;&gt;&#39;??????????.database.windows.net&#39;&lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#808080&quot;&gt;,&lt;/font&gt;&lt;/span&gt;&amp;nbsp;&lt;/font&gt;&lt;span style=&quot;color: &quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot; color=&quot;#008000&quot;&gt;-- Azure server name&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;&lt;span style=&quot;font-family: &quot;&gt;&lt;font color=&quot;#008000&quot; face=&quot;Consolas&quot;&gt;&lt;span style=&quot;color: &quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &quot;&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot;&gt;@location&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#808080&quot;&gt;= &lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#ff0000&quot;&gt;&#39;&#39;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style=&quot;color: &quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot; color=&quot;#808080&quot;&gt;,&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;&lt;span style=&quot;font-family: &quot;&gt;&lt;font color=&quot;#808080&quot; face=&quot;Consolas&quot;&gt;&lt;span style=&quot;color: &quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &quot;&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot;&gt;@provstr&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#808080&quot;&gt;= &lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#ff0000&quot;&gt;N&#39;Encrypt=yes;&#39;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style=&quot;color: &quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot; color=&quot;#808080&quot;&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color=&quot;#008000&quot;&gt;-- * Important!&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;&lt;span style=&quot;font-family: &quot;&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @catalog&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#808080&quot;&gt;= &lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#ff0000&quot;&gt;&#39;RemoteDatabaseName&#39;&lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#808080&quot;&gt;;&lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;mso-spacerun: yes&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/font&gt;&lt;span style=&quot;color: &quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot; color=&quot;#008000&quot;&gt;-- remote(Azure) database name&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;&lt;span style=&quot;font-family: ; color: &quot;&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot; color=&quot;#0000ff&quot;&gt;go&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;&lt;span style=&quot;font-family: &quot;&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot;&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;&lt;span style=&quot;font-family: &quot;&gt;&lt;font color=&quot;#008000&quot; face=&quot;Consolas&quot;&gt;-- Create the login credentials for the linked server&lt;/font&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;span style=&quot;font-family: ; color: &quot;&gt;&lt;font color=&quot;#0000ff&quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot;&gt;EXEC&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot;&gt; &lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#800000&quot;&gt;sp_addlinkedsrvlogin&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style=&quot;color: &quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot; color=&quot;#0000ff&quot;&gt; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;span style=&quot;font-family: &quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot;&gt;&lt;font color=&quot;#0000ff&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;@rmtsrvname&amp;nbsp; &lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#808080&quot;&gt;= &lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#ff0000&quot;&gt;&#39;LocalLinkedServername&#39;&lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#808080&quot;&gt;,&lt;/font&gt;&lt;/span&gt; &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;&lt;span style=&quot;font-family: &quot;&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @useself&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#808080&quot;&gt;= &lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#ff0000&quot;&gt;&#39;false&#39;&lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#808080&quot;&gt;,&lt;/font&gt;&lt;/span&gt; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;&lt;span style=&quot;font-family: &quot;&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;span style=&quot;mso-spacerun: yes&quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;font style=&quot;font-size: 9.5pt&quot;&gt;@rmtuser&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#808080&quot;&gt;= &lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#ff0000&quot;&gt;&#39;remotesqlusername@??????????.database.windows.net&#39;&lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#808080&quot;&gt;,&lt;/font&gt;&lt;/span&gt; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;&lt;span style=&quot;font-family: &quot;&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;span style=&quot;mso-spacerun: yes&quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;font style=&quot;font-size: 9.5pt&quot;&gt;@rmtpassword &lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#808080&quot;&gt;= &lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#ff0000&quot;&gt;&#39;remote password&#39;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style=&quot;color: &quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot; color=&quot;#808080&quot;&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;&lt;span style=&quot;font-family: ; color: &quot;&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot; color=&quot;#0000ff&quot;&gt;go&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;&lt;span style=&quot;font-family: &quot;&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot;&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;&lt;span style=&quot;font-family: &quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;span style=&quot;font-family: ; color: &quot;&gt;&lt;font color=&quot;#0000ff&quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot;&gt;EXEC&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot;&gt; &lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#800000&quot;&gt;sp_serveroption&lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#0000ff&quot;&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#ff0000&quot;&gt;&#39;LocalLinkedServername&#39;&lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#808080&quot;&gt;,&lt;/font&gt;&lt;/span&gt; &lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#ff0000&quot;&gt;&#39;rpc out&#39;&lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#808080&quot;&gt;,&lt;/font&gt;&lt;/span&gt; &lt;span style=&quot;color: &quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot; color=&quot;#ff0000&quot;&gt;&#39;true&#39;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style=&quot;color: &quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot; color=&quot;#808080&quot;&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;&lt;span style=&quot;font-family: ; color: &quot;&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot; color=&quot;#0000ff&quot;&gt;go&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;&lt;span style=&quot;font-family: ; color: &quot;&gt;&lt;font color=&quot;#0000ff&quot; face=&quot;Consolas&quot;&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;&lt;span style=&quot;font-family: ; color: &quot;&gt;&lt;font color=&quot;#008000&quot; face=&quot;Consolas&quot;&gt;-- Don’t elevate to distributed transactions&lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &quot;&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;span style=&quot;font-family: ; color: &quot;&gt;&lt;font color=&quot;#0000ff&quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot;&gt;EXEC&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot;&gt; &lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#800000&quot;&gt;sp_serveroption&lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#0000ff&quot;&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#ff0000&quot;&gt;&#39;LocalLinkedServername&#39;&lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#808080&quot;&gt;,&lt;/font&gt;&lt;/span&gt; &lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#ff0000&quot;&gt;&#39;remote proc transaction promotion&#39;&lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#808080&quot;&gt;,&lt;/font&gt;&lt;/span&gt; &lt;/font&gt;&lt;span style=&quot;color: &quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot; color=&quot;#ff0000&quot;&gt;&#39;false&#39;;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;&lt;span style=&quot;font-family: ; color: &quot;&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot; color=&quot;#0000ff&quot;&gt;go&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &quot;&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;&lt;span style=&quot;font-family: &quot;&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot;&gt;&amp;nbsp;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;&lt;span style=&quot;font-family: ; color: &quot;&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot; color=&quot;#008000&quot;&gt;---- Finally, check you can access remote data via your linked server:&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;span style=&quot;font-family: ; color: &quot;&gt;&lt;font color=&quot;#0000ff&quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot;&gt;select&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot;&gt; &lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#0000ff&quot;&gt;top&lt;/font&gt;&lt;/span&gt; 100 &lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#808080&quot;&gt;*&lt;/font&gt;&lt;/span&gt; &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;span style=&quot;font-family: ; color: &quot;&gt;&lt;font color=&quot;#0000ff&quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot;&gt;from&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot;&gt; [&lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#ff0000&quot;&gt;LocalLinkedServerName&lt;/font&gt;&lt;/span&gt;]&lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#808080&quot;&gt;.&lt;/font&gt;&lt;/span&gt;[&lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#ff0000&quot;&gt;RemoteDatabaseName&lt;/font&gt;&lt;/span&gt;]&lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#808080&quot;&gt;.&lt;/font&gt;&lt;/span&gt;[&lt;font color=&quot;#ff0000&quot;&gt;RemoteSchemaName&lt;/font&gt;]&lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#808080&quot;&gt;.&lt;/font&gt;&lt;/span&gt;[&lt;font color=&quot;#ff0000&quot;&gt;RemoteTableName&lt;/font&gt;]&lt;/font&gt;&lt;span style=&quot;color: &quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot; color=&quot;#808080&quot;&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;&lt;span style=&quot;font-family: ; color: &quot;&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot; color=&quot;#0000ff&quot;&gt;go&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;&lt;span style=&quot;font-family: &quot;&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot;&gt;&amp;nbsp;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;&amp;nbsp;&lt;/p&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;&amp;nbsp;&lt;/p&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;Another issue you might run into is if you have SQL Database auditing turned on in Azure, Azure wants all connections to be from a secure connection string, and if you run the above script from certain versions of SSMS (I believe SQL Server 2012 and below but not verified) then you might get an error saying only connections with secure connection string are allowed (despite a secure connection being specified). The fix is easy, change&lt;/p&gt; &lt;blockquote&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;&lt;span style=&quot;font-family: &quot;&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot;&gt;&lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#ff0000&quot;&gt;myServerName.database.windows.net&lt;/font&gt;&lt;/span&gt; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;to&lt;/p&gt; &lt;blockquote&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;&lt;span style=&quot;font-family: &quot;&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot;&gt;&lt;span style=&quot;color: &quot;&gt;&lt;font color=&quot;#ff0000&quot;&gt;myServerName.database.secure.windows.net&lt;/font&gt;&lt;/span&gt; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;Keep in mind that prior to SQL Server 2012 SP1, remote server statistics won’t be able to be used to determine query plans unless admin credentials are used (not a good idea!). Prior to SQL Server 2012 SP1 there is a workaround shown here: &lt;a href=&quot;http://dba.stackexchange.com/questions/58170/sql-server-linked-servers-and-remote-statistics&quot;&gt;SQL Server Linked Servers and Remote Statistics&lt;/a&gt;&lt;/p&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;&amp;nbsp;&lt;/p&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none&quot;&gt;Refs.:&lt;/p&gt; &lt;p&gt;&lt;a href=&quot;http://thomaslarock.com/2013/05/top-3-performance-killers-for-linked-server-queries/&quot;&gt;TOP 3 PERFORMANCE KILLERS FOR LINKED SERVER QUERIES&lt;/a&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='https://mitch-wheat.blogspot.com/feeds/1846115092951342774/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/28468793/1846115092951342774' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/1846115092951342774'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/1846115092951342774'/><link rel='alternate' type='text/html' href='https://mitch-wheat.blogspot.com/2016/06/sql-server-create-linked-server-from-on.html' title='SQL Server: Create a linked server from an on-premise SQL Server* to SQL Azure'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</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-28468793.post-1568513987224803857</id><published>2016-06-02T16:12:00.001+08:00</published><updated>2016-06-02T16:12:26.872+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL Azure"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server"/><title type='text'>SQL Server and SQL Azure: Clear Plan Cache</title><content type='html'>&lt;p&gt;For on-premise SQL Servers you can run &lt;blockquote&gt;&lt;pre&gt;&lt;font color=&quot;#000000&quot;&gt;&lt;font color=&quot;#0000ff&quot;&gt;dbcc&lt;/font&gt; freeproccache&lt;/font&gt;&lt;/pre&gt;&lt;/blockquote&gt;
&lt;p&gt;which clears the entire server cache (provided you have the &lt;strong&gt;ALTER SERVER STATE&lt;/strong&gt; permission). Many online resources and SQL Server Books Online give scary warnings about running this, but running DBCC FREEPROCCACHE will cause very few problems, even on a busy OLTP system. It will cause a small CPU spike for a few seconds as query plans get recompiled. It can be a useful tool when base-lining expensive queries or stored procedures.
&lt;p&gt;If that’s not selective enough, you can free the cached plans for a single database using an undocumented DBCC command, FLUSHPROCINDB:
&lt;blockquote&gt;&lt;pre&gt;&lt;font color=&quot;#008000&quot;&gt;-- Flush all plans from the plan cache for a single database  
&lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;&lt;font color=&quot;#0000ff&quot;&gt;declare&lt;/font&gt; @dbid int;
&lt;font color=&quot;#0000ff&quot;&gt;select&lt;/font&gt; @dbid = dbid &lt;font color=&quot;#0000ff&quot;&gt;from&lt;/font&gt; master.dbo.sysdatabases &lt;font color=&quot;#0000ff&quot;&gt;where&lt;/font&gt; name = &#39;MyDatabaseName&#39;;

&lt;font color=&quot;#0000ff&quot;&gt;dbcc&lt;/font&gt; flushprocindb(@dbid);&lt;/font&gt;&lt;/pre&gt;&lt;/blockquote&gt;
&lt;p&gt;If you want to remove a single plan from the cache:
&lt;blockquote&gt;&lt;pre&gt;&lt;font color=&quot;#008000&quot;&gt;-- Get the plan handle (varbinary(64)) for a cached query plan&lt;/font&gt;
&lt;font color=&quot;#000000&quot;&gt;&lt;font color=&quot;#0000ff&quot;&gt;select&lt;/font&gt; 
    cp.plan_handle, 
    st.text
&lt;font color=&quot;#0000ff&quot;&gt;from&lt;/font&gt; 
    sys.dm_exec_cached_plans cp 
    &lt;font color=&quot;#0000ff&quot;&gt;cross apply&lt;/font&gt; sys.dm_exec_sql_text(plan_handle) st
&lt;font color=&quot;#0000ff&quot;&gt;where&lt;/font&gt; 
    text &lt;font color=&quot;#0000ff&quot;&gt;LIKE&lt;/font&gt; N&#39;%GetJournal%&#39;;&lt;/font&gt;

&lt;font color=&quot;#008000&quot;&gt;-- Remove a specific plan from the cache using its plan handle&lt;/font&gt;
&lt;font color=&quot;#000000&quot;&gt;&lt;font color=&quot;#0000ff&quot;&gt;dbcc&lt;/font&gt; freeproccache (0x060050000C267C1030CE4EC70300000001000000000000000000000000000000000000000000000000000000);&lt;/font&gt;&lt;/pre&gt;&lt;/blockquote&gt;
&lt;p&gt;&lt;code&gt;&lt;/code&gt;
&lt;p&gt;&lt;code&gt;&lt;font color=&quot;#000000&quot;&gt;DBCC FREEPROCCACHE&lt;/font&gt;&lt;/code&gt; is not supported in SQL Azure as that wouldn’t be practical in a multi-tenanted database environment. SQL Azure (and SQL Server 2016) has introduced a new mechanism for clearing the query plans for a single database:
&lt;blockquote&gt;&lt;pre&gt;&lt;font color=&quot;#000000&quot;&gt;&lt;font color=&quot;#0000ff&quot;&gt;ALTER DATABASE&lt;/font&gt; SCOPED CONFIGURATION CLEAR PROCEDURE_CACHE;&lt;/font&gt;&lt;/pre&gt;&lt;/blockquote&gt;
&lt;p&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/library/mt629158.aspx&quot;&gt;ALTER DATABASE SCOPED CONFIGURATION&lt;/a&gt;
&lt;blockquote&gt;
&lt;p&gt;This statement enables the configuration of a number of database configuration settings at the individual database level, independent of these settings for any other database. This statement is available in both SQL Database V12 [SQL Azure] and in SQL Server 2016. These options are:
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Clear procedure cache.&lt;/p&gt;
&lt;li&gt;
&lt;p&gt;Set the MAXDOP parameter to an arbitrary value (1,2, ...) for the primary database based on what works best for that particular database and set a different value (e.g. 0) for all secondary database used (e.g. for reporting queries).&lt;/p&gt;
&lt;li&gt;
&lt;p&gt;Set the query optimizer cardinality estimation model independent of the database to compatibility level.&lt;/p&gt;
&lt;li&gt;
&lt;p&gt;Enable or disable parameter sniffing at the database level.&lt;/p&gt;
&lt;li&gt;
&lt;p&gt;Enable or disable query optimization hotfixes at the database level.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt;
&lt;h5&gt;&lt;a href=&quot;https://blogs.msdn.microsoft.com/sqlserverstorageengine/2016/05/02/database-scoped-configuration/&quot;&gt;Database Scoped Configuration&lt;/a&gt;&lt;/h5&gt;</content><link rel='replies' type='application/atom+xml' href='https://mitch-wheat.blogspot.com/feeds/1568513987224803857/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/28468793/1568513987224803857' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/1568513987224803857'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/1568513987224803857'/><link rel='alternate' type='text/html' href='https://mitch-wheat.blogspot.com/2016/06/sql-server-and-sql-azure-clear-plan.html' title='SQL Server and SQL Azure: Clear Plan Cache'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</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-28468793.post-8710940341804890024</id><published>2014-03-04T14:16:00.001+08:00</published><updated>2014-03-04T14:16:17.911+08:00</updated><title type='text'>SSAS: The Measures cube either does not exist or has not been processed</title><content type='html'>&lt;p&gt;If you are attempting to deploy your existing SQL Server Analysis Services cube with calculation changes and get the following (not very helpful!) error:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;“&lt;font face=&quot;Courier New&quot;&gt;The Measures cube either does not exist or has not been processed&lt;/font&gt;”&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;then you probably forgot a &lt;font face=&quot;Courier New&quot;&gt;CURRENTCUBE&lt;/font&gt; prefix on one or more of your MDX Create Member statements:&lt;/p&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;CREATE&lt;/span&gt; MEMBER CURRENTCUBE.Measures.[MyMeasure] &lt;span class=&quot;kwrd&quot;&gt;AS&lt;/span&gt;&lt;br /&gt;              ^^^^^^^^^^^&lt;/pre&gt;  </content><link rel='replies' type='application/atom+xml' href='https://mitch-wheat.blogspot.com/feeds/8710940341804890024/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/28468793/8710940341804890024' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/8710940341804890024'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/8710940341804890024'/><link rel='alternate' type='text/html' href='https://mitch-wheat.blogspot.com/2014/03/ssas-measures-cube-either-does-not.html' title='SSAS: The Measures cube either does not exist or has not been processed'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</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-28468793.post-4273964962299070144</id><published>2013-12-01T09:08:00.001+08:00</published><updated>2013-12-01T09:20:30.847+08:00</updated><title type='text'>SQL Server Agent Job Visualisation: SQLjobvis</title><content type='html'>&lt;p&gt;SQL Server must be older than 20 years and yet it still has no agent job schedule visualiser, despite the fact it has been asked for many times. How can that be? Go figure…&lt;/p&gt; &lt;p&gt;I needed one at work recently to identify schedule clashes, so I thought “I wonder how hard it would be to write something fairly basic”. Then programmer laziness swiftly kicked in and the next thought was “If this problem is a pain for so many, then someone must have written something already…?&quot;&lt;/p&gt; &lt;p&gt;And of course, they have: &lt;strong&gt;&lt;a href=&quot;http://www.sqlsoft.co.uk/sqljobvis.php&quot;&gt;SQLjobvis&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;It’s basic, simple, works great, and it’s &lt;strong&gt;&lt;font size=&quot;3&quot;&gt;free&lt;/font&gt;&lt;/strong&gt;!&lt;/p&gt; &lt;p&gt;It instantly identifies:&lt;/p&gt; &lt;li&gt;Failures  &lt;li&gt;Long-running jobs  &lt;li&gt;Multiple jobs running simultaneously  &lt;p&gt;Brilliant! &lt;/p&gt; &lt;p&gt;&lt;/p&gt;&lt;/li&gt;  </content><link rel='replies' type='application/atom+xml' href='https://mitch-wheat.blogspot.com/feeds/4273964962299070144/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/28468793/4273964962299070144' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/4273964962299070144'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/4273964962299070144'/><link rel='alternate' type='text/html' href='https://mitch-wheat.blogspot.com/2013/12/sql-server-agent-job-visualisation.html' title='SQL Server Agent Job Visualisation: SQLjobvis'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</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-28468793.post-1804071529464754354</id><published>2013-05-13T11:36:00.001+08:00</published><updated>2013-05-13T11:36:51.429+08:00</updated><title type='text'>Office 2013 Rant: Not wearing any Clothes!</title><content type='html'>&lt;p&gt;Having not been able to automatically upgrade to the 64bit version of Office (having the 32 bit version of 2010 installed), I installed the 32bit version of Office 2013, so I could try out a few of Excel’s new features (Yeah, I know I should have VM’ed, but I trust those programmers at Microsoft…)&lt;/p&gt; &lt;p&gt;Unfortunately, just like VS2012, Microsoft have broken just about every well established and tried and tested UI design rule: and not for the better. Office 2013 looks as if the folks at Microsoft have confused the concepts of reducing too much ‘Chrome’ with proper visual ‘Demarcation’. Having everything blend into everything else is not a good UI, by any measure. I’m gobsmacked that they could have produced something so poor. It’s simply, bloody awful! Microsoft: The Emperor isn’t wearing any clothes!!&lt;/p&gt; &lt;p&gt;I don’t believe this design ‘strategy’ was done to benefit users. It was done so that Microsoft can seamlessly (supposedly) integrate their mobile and desktop markets. This is not a strategy –&amp;gt;&amp;nbsp; “We need to shift our emphasis to the mobile market (we sure as hell aren’t selling many versions of Windows 8 for the desktop), lets change our UI to ‘fit’ tablets. Bugger the existing desktop users…”. I’m sorry but that’s a Fail.&lt;/p&gt; &lt;p&gt;BTW, looks like some Microsoft Teams didn’t get the memo about using All CAPS!! (Excel 2013 [Vanilla] Screenshot)&lt;/p&gt; &lt;p&gt;&lt;a href=&quot;http://lh3.ggpht.com/-K6vm7XGNwfM/UZBfzhbczeI/AAAAAAAAARY/koC9e5IjsCM/s1600-h/image7.png&quot;&gt;&lt;img title=&quot;image&quot; style=&quot;border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://lh5.ggpht.com/-1jEHAHqyq5E/UZBf0TgT4uI/AAAAAAAAARg/IUpeKUfDmmA/image_thumb3.png?imgmax=800&quot; width=&quot;871&quot; height=&quot;94&quot;&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&lt;/p&gt; &lt;p&gt;&lt;/p&gt; &lt;p&gt;Was making Windows 8 share a similar interface to the phone and tablets done to benefit end users? Seems unlikely. Windows 8 is shaping up to be another Vista (Microsoft have been very shy the last 2 quarters and not released the sales figures for Windows 8). Looking forward to having the Start button back? Windows codenamed ‘Blue’ is coming soon…Hurrah!&lt;/p&gt; &lt;p&gt;Sad thing is, I really want to like Microsoft products. SQL Server is by far the best software I’ve ever used. It is awesome. &lt;/p&gt; &lt;p&gt;So having said all that, I thought I’d give 2013 ago to see if I could subdue my bias and get used to the rather poor UI. First email I try to send, Outlook 2013 crashes. Restart. Try again, it crashes. I’ve used Outlook 2010 every day for over 2 years and haven’t had a single crash. &lt;/p&gt; &lt;p&gt;Uninstalled Office 2013. HELLO Office 2010 !&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='https://mitch-wheat.blogspot.com/feeds/1804071529464754354/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/28468793/1804071529464754354' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/1804071529464754354'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/28468793/posts/default/1804071529464754354'/><link rel='alternate' type='text/html' href='https://mitch-wheat.blogspot.com/2013/05/office-2013-rant-not-wearing-any-clothes.html' title='Office 2013 Rant: Not wearing any Clothes!'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</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><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh5.ggpht.com/-1jEHAHqyq5E/UZBf0TgT4uI/AAAAAAAAARg/IUpeKUfDmmA/s72-c/image_thumb3.png?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></entry></feed>