Skip to content
Permalink
Browse files

slug fixes applied

  • Loading branch information...
sheldonhull committed Apr 8, 2019
1 parent 0646a2b commit ba09ee67f34224ed0cd7270cb6fd5e8c0413b85f
Showing with 311 additions and 170 deletions.
  1. +2 −2 content/_index.md
  2. +2 −2 content/about.md
  3. +2 −1 ...-04-17-how-to-default-ssrs-date-parameters-to-the-first-and-last-day-of-the-the-previous-month.md
  4. +2 −1 content/blog/2013-04-18-dynamic-sql-and-a-char-crash.md
  5. +2 −1 content/blog/2013-04-22-native-ssms-a-second-class-citizen-no-longer.md
  6. +2 −1 content/blog/2013-04-23-snippet-designate-a-certain-time-of-the-day-in-getdate().md
  7. +2 −1 content/blog/2013-04-30-installing-ssms-2012-all-by-it's-lonesome.md
  8. +2 −2 content/blog/2013-05-01-calculating-the-next-beginning-of-month-and-the-current-end-of-month.md
  9. +2 −2 content/blog/2013-05-21-get-synonym-definitions-for-all-databases-in-server.md
  10. +2 −1 content/blog/2013-05-22-on-how-to-googlify-your-sql-statements-for-future-searching.md
  11. +2 −2 content/blog/2013-05-22-view-computed-columns-in-database.md
  12. +2 −1 ...0-a-moment-of-void-in-the-cranium-reveals-a-recursive-computed-column-with-an-esoteric-message.md
  13. +2 −2 ...og/2013-05-31-tsql-snippet-for-viewing-basic-info-on-database-principals-and-their-permissions.md
  14. +2 −1 ...me-organization-to-the-random-pile-of-objects-gathering-in-the-dusty-confines-of-that-database.md
  15. +2 −2 ...check-constraints-can-help-enforce-the-all-or-nothing-approach-when-it-comes-to-column-updates.md
  16. +2 −1 ...ent/blog/2013-07-24-shortcut-to-reference-examples,-syntax,-and-definitions-straight-from-ssms.md
  17. +1 −0 ...erences-inside-stored-procedures-and-functions-can-be-migraine-worthy-without-a-little-help....md
  18. +2 −1 content/blog/2014-02-11-scalar-functions-can-be-the-hidden-boogie-man.md
  19. +2 −1 content/blog/2014-05-19-eliminate-overlapping-dates.md
  20. +2 −1 content/blog/2014-05-19-finding-groups-consecutive-months.md
  21. +2 −1 content/blog/2014-08-11-snippet-alert-useful-dates-(eom,-bom,-etc).md
  22. +2 −1 content/blog/2014-08-12-generate-random-date-with-starting-point.md
  23. +2 −1 content/blog/2014-12-02-get-information-on-current-traces-running.md
  24. +2 −1 content/blog/2014-12-11-or-pattern-causing-indexing-scans-in-parameter-based-queries.md
  25. +1 −0 content/blog/2014-12-24-dev-tools-x-yplorer-(review-1)-catalog.md
  26. +2 −1 ...5-01-05-case-of-the-mondays...-causing-me-to-randomly-redefine-the-scope-of-global-temp-tables.md
  27. +2 −1 content/blog/2015-01-13-dev-tools-the-file-searcher-launcher-to-rule-them-all.md
  28. +2 −1 content/blog/2015-01-16-dev-tools-farr2-launching-groups-of-files-or-apps-at-once.md
  29. +2 −1 content/blog/2015-01-21-statistics-parsing.md
  30. +2 −1 content/blog/2015-04-28-restoring-a-database-that-doesn't-exist.md
  31. +1 −0 content/blog/2015-04-28-sql-sentry-pro-explorer-is-worth-it....md
  32. +1 −0 ...e-parameters-to-reduce-io,-improve-performance,-decrease-pollution,-and-achieve-world-peace....md
  33. +2 −1 content/blog/2015-05-04-upgrade-from-sql-2014-evaluation-to-developer-edition.md
  34. +2 −1 content/blog/2015-05-22-enabling-instant-file-initialization.md
  35. +2 −1 content/blog/2015-06-24-some-simple-examples-of-querying-xml-with-sql.md
  36. +2 −1 content/blog/2015-07-13-what-was-i-thinking-deleting-myself-from-localdb.md
  37. +2 −1 content/blog/2015-07-28-database-stuck-in-single-user-mode-due-to-botched-restore.md
  38. +2 −1 content/blog/2015-08-05-running-very-large-scripts-is-not-a-strong-area-for-ssms.md
  39. +2 −1 content/blog/2015-08-07-set-noexec-is-my-new-friend.md
  40. +2 −1 content/blog/2015-08-10-using-qure-profiler-to-benchmark-tuning-progress.md
  41. +2 −1 content/blog/2015-08-12-red-gate-sql-source-control-v4-offers-schema-locks.md
  42. +2 −1 content/blog/2015-08-13-stranger-danger...-the-need-for-trust-with-constraints.md
  43. +2 −1 content/blog/2015-08-18-monitoring-sql-server-on-a-budget.md
  44. +2 −1 content/blog/2015-08-27-brentozar's-training-chocolate-&-cowboy-hats-included.md
  45. +2 −1 content/blog/2015-09-10-multi-cursor-editing-sql-feels-like-the-movie-inception-just-became-real.md
  46. +2 −1 content/blog/2015-09-14-split-personality-text-eiting-in-ssms-with-sublime-text-3.md
  47. +2 −1 content/blog/2015-09-21-xml-attribute-vs-element-assignment-when-working-with-sql.md
  48. +2 −1 content/blog/2015-09-23-dynamic-sql-&-quotename.md
  49. +2 −1 content/blog/2015-10-14-best-tools-for-taking-notes-in-development.md
  50. +2 −1 content/blog/2015-12-09-documenting-your-database-with-diagrams.md
  51. +2 −1 content/blog/2015-12-15-model-needs-exclusive-lock.md
  52. +2 −1 content/blog/2016-01-05-transaction-logging-&-recovery-(101).md
  53. +2 −1 content/blog/2016-01-08-transaction-logging-&-recovery-(part-2).md
  54. +2 −1 content/blog/2016-01-13-verifying-instant-file-initialization.md
  55. +2 −1 content/blog/2016-01-20-seeker-&-servant-fantastic-music-with-incredible-dynamics.md
  56. +2 −1 content/blog/2016-01-20-transaction-logging-&-recovery-(part-3).md
  57. +2 −1 content/blog/2016-01-25-diff-all-files-reviewing-changesets-quickly.md
  58. +2 −1 content/blog/2016-01-29-easy-way-to-test-log-shipping-or-availability-groups-setup.md
  59. +2 −1 content/blog/2016-03-18-calculating-some-max-mirror-stats.md
  60. +2 −1 content/blog/2016-03-18-failover-all-databases-to-other-server.md
  61. +2 −1 content/blog/2016-03-18-previewing-the-new-ssrs-2016-portal.md
  62. +2 −1 content/blog/2016-03-18-sql-2012-sp3-and-entity-framework-conflict.md
  63. +2 −1 content/blog/2016-03-18-tfs-work-item-fancy-filtering.md
  64. +2 −1 content/blog/2016-04-01-failed-to-initialize-sql-agent-log...-not-worthy.md
  65. +2 −1 content/blog/2016-04-14-cool-tools-powershell-ise-steroids.md
  66. +2 −1 content/blog/2016-04-27-automating-ssms-2016-updates-&-install.md
  67. +2 −1 content/blog/2016-04-27-google-search-only-results-from-the-last-year.md
  68. +2 −1 content/blog/2016-04-28-red-gate-dependency-tracker-making-databases-into-moving-art.md
  69. +2 −1 content/blog/2016-05-15-the-mysterious-black-box-of-r-for-the-sql-server-guy.md
  70. +2 −1 content/blog/2016-05-16-continual-deployment-of-visual-studio-sql-proj.md
  71. +2 −1 content/blog/2016-06-14-omni-compare-a-free-tool-to-compare-sql-instances.md
  72. +2 −1 content/blog/2016-06-17-ssms-tools-pack-a-handy-tool-for-generating-crud.md
  73. +2 −1 content/blog/2016-06-26-sql-compare-12-initial-look.md
  74. +2 −1 ...t/blog/2016-07-01-glasswire-(giveaway-included)-networking-monitoring-even-a-caveman-could-use.md
  75. +2 −1 content/blog/2016-07-12-improvements-with-ssms-2016.md
  76. +2 −1 content/blog/2016-08-11-regex-with-sql-server-sql-sharp.md
  77. +2 −1 content/blog/2016-08-15-does-sp-rename-on-a-column-preserve-the-ms-description.md
  78. +2 −1 content/blog/2016-08-18-install-ready-roll-via-command-line.md
  79. +2 −1 content/blog/2016-08-19-sql-2016-brief-overview-on-some-new-features.md
  80. +2 −1 content/blog/2016-08-23-ssms-connection-color-with-sql-prompt-&-ssms-boost.md
  81. +2 −1 content/blog/2016-08-29-remote-desktop-workflow-improvements.md
  82. +2 −1 content/blog/2016-09-14-lack-for-nothing.md
  83. +2 −1 content/blog/2016-09-17-ableton-live-&-lemur-setup-(from-a-windows-user).md
  84. +2 −1 content/blog/2016-09-19-setting-dbcc-1222-on-startup.md
  85. +2 −1 content/blog/2016-09-20-daw-dive-1-getting-started-studio-one-3.md
  86. +2 −1 content/blog/2016-09-21-sql-2016-configuration-manager-not-showing-in-start-menu.md
  87. +2 −1 content/blog/2016-10-09-fixing-non-deterministic-error-when-creating-indexed-view.md
  88. +2 −1 content/blog/2016-10-09-powershell-ise-updating-theme.md
  89. +2 −1 content/blog/2016-10-09-syncovery-&-arq-syncing-&-backup.md
  90. +2 −1 content/blog/2016-10-10-migrating-database-collation-the-red-gate-way.md
  91. +2 −1 content/blog/2016-10-11-daw-dive-02-bfd3-drumming-for-the-rest-of-us.md
  92. +2 −1 content/blog/2016-10-16-centralized-management-server-101.md
  93. +2 −1 content/blog/2016-10-17-cannot-generate-sspi-context.md
  94. +2 −1 content/blog/2016-10-18-easy-sql-maintenance-with-minionware.md
  95. +2 −1 content/blog/2016-10-20-an-internet-with-less-ads-adguard.md
  96. +2 −1 content/blog/2016-10-22-fixing-untrusted-foreign-key-or-check-constraint.md
  97. +2 −1 content/blog/2016-10-28-data-compare-on-temporal-tables.md
  98. +2 −1 content/blog/2016-10-29-pizzicato-pizza.md
  99. +2 −1 content/blog/2016-11-01-get-backup-history-for-all-databases-in-server.md
  100. +2 −1 content/blog/2016-11-16-parallel-powershell-for-running-sql.md
  101. +2 −1 content/blog/2016-11-18-attaching-database-using-smo-and-powershell.md
  102. +2 −1 content/blog/2016-11-22-scan-folder-of-dlls-to-identify-x86-or-x64-compiled-assemblies.md
  103. +2 −1 content/blog/2016-12-03-the-traditional-birthday-song-is-terrible.md
  104. +2 −1 content/blog/2016-12-05-dynamically-set-powershell-variables-from-json.md
  105. +2 −1 content/blog/2016-12-09-manictime-timetracking-automation-done-right.md
  106. +2 −1 content/blog/2017-01-23-bad-idea-jeans-query-optimization-through-minification.md
  107. +2 −1 content/blog/2017-02-18-implicit-transactions.md
  108. +2 −1 content/blog/2017-02-18-quick-way-to-run-powershell-tasks-in-parallel.md
  109. +2 −1 content/blog/2017-02-18-redgate-sql-data-compare-&-devart-db-forge-data-compare.md
  110. +2 −1 content/blog/2017-02-18-ssms-2016-object-explorer-read-uncommitted.md
  111. +2 −2 content/blog/2017-02-18-track-creation-of-databases.md
  112. +2 −1 content/blog/2017-02-24-life-hack-when-you-need-a-mouse-pad.md
  113. +2 −1 content/blog/2017-02-27-red-gate-sql-clone-1-initial-setup.md
  114. +2 −1 content/blog/2017-03-07-tfs-custom-task-service-actions-(for-tfs-2015-update-2.1-or-before).md
  115. +5 −4 content/blog/2017-05-08-programming-fonts-for-the-newb.md
  116. +2 −1 content/blog/2017-05-10-automate-windows-updates-for-development.md
  117. +2 −1 content/blog/2017-05-17-setting-up-influx-db-chronograf-and-grafana-for-the-sql-server-dev.md
  118. +2 −1 content/blog/2017-05-24-running-influx-db-as-a-service-in-windows.md
  119. +2 −2 content/blog/2017-05-31-powershell-module-improvements-for-sql-server-in-2017.md
  120. +2 −1 content/blog/2017-06-07-add-user-to-admin-group-on-machine.md
  121. +2 −2 content/blog/2017-06-07-best-practices-defining-explicit-length-for-varchar-nvarchar.md
  122. +2 −1 content/blog/2017-06-26-edit-in-vscode.md
  123. +2 −1 content/blog/2017-07-03-update-ssms-with-ps1.md
  124. +2 −1 content/blog/2017-07-21-ants-performance-profiler-for-the-sql-server-dev.md
  125. +2 −1 content/blog/2017-08-05-spotify-vs-google-play.md
  126. +2 −1 content/blog/2017-08-07-dataedo-first-look.md
  127. +2 −1 content/blog/2017-08-07-influx-db-and-annotations.md
  128. +2 −1 content/blog/2017-08-08-capturing-perfmon-counters-with-telegraf.md
  129. +2 −1 content/blog/2017-08-09-exploring-sql-server-with-powershell-and-smo-basics.md
  130. +2 −1 content/blog/2017-08-11-fixing-virtual-box-only-showing-32bit-windows-os-options.md
  131. +2 −2 content/blog/2017-08-16-ultrawide-monitor-samsung-cf971-first-impressions.md
  132. +2 −1 content/blog/2017-08-29-a-not-so-waterlogged-texan-tuesday.md
  133. +2 −1 content/blog/2017-08-29-a-waterlogged-texan-reporting-in-from-northpoint-tomball.md
  134. +2 −1 content/blog/2017-09-03-recovery-is-a-marathon,-not-a-sprint-hurricane-harvey.md
  135. +2 −1 content/blog/2017-09-08-welcome-to-the-world-little-ella.md
  136. +2 −1 content/blog/2017-09-29-origami-101.md
  137. +2 −1 content/blog/2017-11-10-delight-in-the-little-moments.md
  138. +2 −1 content/blog/2017-12-31-time-with-family-thanksgiving.md
  139. +2 −1 content/blog/2018-03-18-migration-to-jekyll.md
  140. +2 −1 content/blog/2018-03-29-git-cracking.md
  141. +2 −2 content/blog/2018-03-30-offline-net35-install.md
  142. +2 −1 content/blog/2018-07-23-deleting-a-directory-that-has-a-trailing-space-shouldn-t-be-this-hard.md
  143. +2 −1 content/blog/2018-08-08-ntfs-compression-and-sql-server-dont-play-well-together.md
  144. +2 −1 content/blog/2018-08-19-dedupe-google-drive-with-rclone.md
  145. +2 −1 content/blog/2019-02-07-migrating-from-hipchat-to-slack.md
  146. +2 −1 content/blog/2019-02-07-sql-server-database-experimentation-assistance-how-to-run-a-capture.md
  147. +2 −1 content/blog/2019-03-11-debugging-type-binding-in-powershell.md
  148. +2 −2 content/blog/_index.md
  149. +2 −1 content/docs/_index.md
  150. +2 −2 content/docs/awspowershell.md
  151. +1 −0 content/docs/dbatools.md
  152. +1 −0 content/docs/powershell.md
  153. +1 −1 content/json.md
  154. +2 −2 content/photography/_index.md
  155. +1 −0 content/search-index.md
  156. +2 −1 content/search.md
  157. +4 −3 scripts/fix-slugs.ps1
@@ -1,7 +1,7 @@
---
date: "2017-06-26T18:27:58+01:00"
title : "Home"
slug: "Home"
slug: "_index"
---

### Sheldon Hull
@@ -12,4 +12,4 @@ slug: "Home"
<i class="fas fa-terminal">&nbsp; &nbsp; &nbsp; &nbsp; PowerShell & Automation</i><br>
<i class="fab fa-aws">&nbsp; &nbsp; &nbsp; &nbsp; AWS</i><br>
<i class="fas fa-laptop-code">&nbsp; &nbsp; &nbsp; &nbsp; Avid user of tools, dark themes, and reticulator of splines</i><br>
</ul>
</ul>
@@ -2,7 +2,7 @@
permalink: "/about/"
layout: single
title: "About"
slug: "About"
slug: "about"
excerpt: about me
last_modified_at: 2019-02-21 00:00:00 +0000
sidebar:
@@ -40,4 +40,4 @@ My passions extend beyond technology into the creative realm as well. I've enjoy
<iframe src="https://open.spotify.com/embed/user/g00p3k/playlist/4wrFiI6chFbzEx4fAb9ztX" width="300" height="380" frameborder="0" allowtransparency="true"></iframe>

If you want to check out some new music, this is my up to date "on deck" playlist of music I rock out to.
<iframe src="https://open.spotify.com/embed/user/g00p3k/playlist/6iTEfldMfbgbuUwzSdib4X" width="300" height="380" frameborder="0" allowtransparency="true"></iframe>
<iframe src="https://open.spotify.com/embed/user/g00p3k/playlist/6iTEfldMfbgbuUwzSdib4X" width="300" height="380" frameborder="0" allowtransparency="true"></iframe>
@@ -3,7 +3,7 @@ date: "2013-04-17T00:00:00Z"
tags:
- sql-server
title : "How to default SSRS date parameters to the first and last day of the the previous month"
slug: "How to default SSRS date parameters to the first and last day of the the previous month"
slug: "how-to-default-ssrs-date-parameters-to-the-first-and-last-day-of-the-the-previous-month"
---

Populating default dates in SSRS can be helpful to save the user from having to constantly input the date range they normally would use. When a report is pulled for last month's information, defaulting the date fields for the user can help streamline their usage of the report, instead of them manually selecting with the date-picker control in SSRS. The formula's I used were:
@@ -23,3 +23,4 @@ To set the default date of the parameters:
3. Paste the formula into the expression field and save.

Result: Your default dates should now show last month's date range. You can apply your own rounding or date types if you wish, this provides the time as well, since I was working with smalldatetime, datetime, and datetime2 datatypes.

@@ -3,7 +3,7 @@ date: "2013-04-18T00:00:00Z"
tags:
- sql-server
title: "dynamic sql and a char crash"
slug: "dynamic sql and a char crash"
slug: "dynamic-sql-and-a-char-crash"
---

Dynamic SQL can be helpful, but a pain to debug. I spent hours today working on figuring out why my simple date comparison in dynamic SQL wasn't working. Found out that the remote database I was connecting to had a char date instead of a datetime. I found the comparison of CHARDATE > VARCHARDATE failed to error out, but also failed to give a proper result set. Changing the look-up to ensure both dates were converted to date fixed the issue. During this debugging I was reviewing my dynamically created SQL statement.
@@ -13,3 +13,4 @@ I learned that SSMS limits the amount of text it will return. In trying to view
Enter [SSMSBoost ](www.ssmsboost.com)to the rescue!

SSMSboost is created by developers and very responsive to requests. I'll do a proper review soon. They offer a visualize data option that goes beyond the usage I employed. For my purpose, I clicked on the cell and selected visual cell as text, and opened the data in notepad++. This showed the full text without truncation. I was able to move on in my debugging then as I knew the dynamic sql statement was not actually truncated except to my SSMS output. Dynamic SQL is a great tool, but if I had been working with direct queries, the issue would have been much faster to resolve!

@@ -6,7 +6,7 @@ tags:
- sql-server
- cool-tools
title: "Native SSMS a second class citizen no longer..."
slug: "Native SSMS a second class citizen no longer..."
slug: "native-ssms-a-second-class-citizen-no-longer"
toc: true
---

@@ -159,3 +159,4 @@ Once you utilize a tool like this, you'll find that the improvements help you fo
## Disclaimer
I do not work for Devart or any competing product. I reviewed this program since I've been sold on the value of it, and wanted to participate in their High Five program which helps developers that like their products share with others, and be eligible for discount/reward if a review of their product is completed. I believe the tool to be useful, and has improved my experience with SSMS. I hope other SQL developers can benefit, especially those who were unaware of the availability of such a great addin.
@@ -3,11 +3,12 @@ date: "2013-04-23T00:00:00Z"
tags:
- sql-server
title: "snippet designate a certain time of the day in getdate()"
slug: "snippet designate a certain time of the day in getdate()"
slug: "snippet-designate-a-certain-time-of-the-day-in-getdate()"
---

Snippet to designate a certain time of the day to evaluate in the current day. If you need to limit a result to the current date after a particular time, strip the time out of the date, and concatenate the current time together with it, and then convert back to datetime2.

```sql
select convert(datetime2(0),cast(cast(getdate() as date) as varchar(10)) + ' 09:00 ')
```

@@ -3,7 +3,7 @@ date: "2013-04-30T00:00:00Z"
tags:
- sql-server
title: "Installing SSMS 2012 all by it's lonesome"
slug: "Installing SSMS 2012 all by it's lonesome"
slug: "installing-ssms-2012-all-by-it's-lonesome"
---

SQL Server Management Studio (SSMS) is not offered as a standalone download on MSDN. Installation requires the user to download the sql server installation package and choose to install only this single feature. For developers, SQL Developer edition is a great choice.
@@ -41,3 +41,4 @@ Here's some screenshots to give you a guide on installing SSMS by itself when wo
<hr>
![install_ssms2012_13](/images/install_ssms2012_13_zdlukh.jpg)
<hr>

@@ -3,7 +3,7 @@ date: "2013-05-01T00:00:00Z"
tags:
- sql-server
title: "Calculating the next beginning of month and the current end of month"
slug: "Calculating the next beginning of month and the current end of month"
slug: "calculating-the-next-beginning-of-month-and-the-current-end-of-month"
---

Handling dates is always a fun challenge in T-SQL! Finding the current end of month and next months beginning of month is straight forward, but I like to find new ways to do things that take less coding, and hate date conversions that require a lot of manipulation of characters and concatenation. This was what I came up with for avoiding character conversions and concatenation for finding the current BOM (beginning of month) and EOM (end of month) values. Adjust according to your needs. Cheers!
@@ -18,4 +18,4 @@ Handling dates is always a fun challenge in T-SQL! Finding the current end of mo
-- subtract a day from the beginning of next month to get the current end of month, without worrying about 28, 30, or 31 days.
declare @ThisEom date = dateadd(day,-1,@NextBom)
select @ThisMonth select @NextBom select @ThisEom
```
```
@@ -3,7 +3,7 @@ date: "2013-05-21T00:00:00Z"
tags:
- sql-server
title: "Get synonym definitions for all databases in server"
slug: "Get synonym definitions for all databases in server"
slug: "get-synonym-definitions-for-all-databases-in-server"
---

If you want to audit your enviroment to look at all your synonyms and see where they are pointing, you can use `exec sys.sp_MSforeachdb` to loop through databases, and even filter. It will save some coding. However, [my research indicates it is probably a bad practice to rely on this undocumented function as it may have issues not forseen and fully tested](http://shaunjstuart.com/archive/2012/10/its-time-to-retire-sp_msforeachdb/).
@@ -84,4 +84,4 @@ Additionally, support may drop for it in the future. I recreated what I needed w
*
from
#temp t
```
```
@@ -5,7 +5,7 @@ tags:
- sql-server
- cool-tools
title: "On how to Googlify your SQL statements for future searching"
slug: "On how to Googlify your SQL statements for future searching"
slug: "on-how-to-googlify-your-sql-statements-for-future-searching"
toc: true
---

@@ -54,3 +54,4 @@ I setup as follows:

1. Now the DocFetcher daemon will run in the background, if you copied my settings, and update your indexes. Searching requires no complex regex, and can be done easily with statements. I'd caution on putting exact phrases in quotes, as it does detect wildcards.
![DocFetcher_previewSearch](/images/DocFetcher_previewSearch_m2g07n.jpg)

@@ -3,7 +3,7 @@ date: "2013-05-22T00:00:00Z"
tags:
- sql-server
title: "View computed columns in database"
slug: "View computed columns in database"
slug: "view-computed-columns-in-database"
---

Snippet to quickly view computed column information. You can also view this by doing a "create table" script. This however, was a little cleaner to read and view for me.
@@ -22,4 +22,4 @@ from
sys.computed_columns cc
order
by full_object_name asc
```
```
@@ -3,9 +3,10 @@ date: "2013-05-30T00:00:00Z"
tags:
- sql-server
title: "A moment of void in the cranium reveals a recursive computed column with an"
slug: "A moment of void in the cranium reveals a recursive computed column with an esoteric message"
slug: "a-moment-of-void-in-the-cranium-reveals-a-recursive-computed-column-with-an-esoteric-message"
---

`Msg 402, Level 16, State 1, Line 67 The data types varchar and void type are incompatible in the add operator.`

I came across this error today when I accidentally used a computed column in a temp table, that referenced itself. This very unhelpful message was caused by referring to the computed column itself in the computed column definition, ie typo. Beware!

@@ -3,7 +3,7 @@ date: "2013-05-31T00:00:00Z"
tags:
- sql-server
title: "TSQL Snippet for viewing basic info on database principals and their permissions"
slug: "TSQL Snippet for viewing basic info on database principals and their permissions"
slug: "tsql-snippet-for-viewing-basic-info-on-database-principals-and-their-permissions"
---

Quick snippet I put together for reviewing basic info on database users/principals, permissions, and members if the principal is a role.:
@@ -75,4 +75,4 @@ Quick snippet I put together for reviewing basic info on database users/principa
sys.database_principals dp
order by
dp.name asc;
```
```
@@ -4,7 +4,7 @@ tags:
- sql-server
- cool-tools
title: "SSMS 2012 Extender for the times you want some organization to the random pile"
slug: "SSMS 2012 Extender for the times you want some organization to the random pile"
slug: "ssms-2012-extender-for-the-times-you-want-some-organization-to-the-random-pile-of-objects-gathering-in-the-dusty-confines-of-that-database"
of objects gathering in the dusty confines of that database
---

@@ -13,3 +13,4 @@ When dealing with large amounts of objects in a database, navigation can be tedi
[SSMS 2012 Extender ](https://ssms2012extender.codeplex.com/ "SSMS 2012 Extender")

![ObjectExplorer_2013-07-16_07-35-51](/images/ObjectExplorer_2013-07-16_07-35-51_uxfdyj.png)

@@ -3,7 +3,7 @@ date: "2013-07-18T00:00:00Z"
tags:
- sql-server
title: "Check Constraints can help enforce the all or nothing approach when it comes"
slug: "Check Constraints can help enforce the all or nothing approach when it comes"
slug: "check-constraints-can-help-enforce-the-all-or-nothing-approach-when-it-comes-to-column-updates"
to column updates
---

@@ -61,4 +61,4 @@ where
order by
t.TABLE_SCHEMA asc
go
```
```
@@ -3,7 +3,7 @@ date: "2013-07-24T00:00:00Z"
tags:
- sql-server
title: "Shortcut to reference examples, syntax, and definitions straight from SSMS"
slug: "Shortcut to reference examples, syntax, and definitions straight from SSMS"
slug: "shortcut-to-reference-examples,-syntax,-and-definitions-straight-from-ssms"
---

I've never really used the F1 key for help files with most applications. I was surprised at the usefulness in SSMS I discovered today that uses scripting to actually get you MSDN articles relevant to your current selection in the query editor.
@@ -14,3 +14,4 @@ If you have a keyword selected and want to view details, definition, and example
![f1_shortcut_query](/images/f1_shortcut_query_kfowoy.png)

![f1_shortcut_results](/images/f1_shortcut_results_cayikt.png)

@@ -17,3 +17,4 @@ I'll post up one for views and synonyms later, as my time was limited to post th
This script might help save you some time!

{{% gist fd2e49f4f69202cd2da6 %}}

@@ -3,11 +3,12 @@ date: "2014-02-11T00:00:00Z"
tags:
- sql-server
title: "Scalar functions can be the hidden boogie man"
slug: "Scalar functions can be the hidden boogie man"
slug: "scalar-functions-can-be-the-hidden-boogie-man"
---

Ran across a comment the other day that scalar functions prohibit parallelism for a query when included. I thought it would be worth taking a look, but didn't take it 100% seriously. Came across the same indication today when reviewing MVP deep dives, so I put it to the test.Turns out even a simple select with a dateadd in a scalar format was affected enough with that one action to drop 5% on the execution plan. When dealing with merge or other processes that would benefit from parallelism, this would become even more pronounced.
Suggest reading "Death by UDF" section by Kevin Boles.
This comment is buried at the very end of the chapter. He indicates

> "One final parting gift: scalar UDFs also void the use of parallel query plans, which is why the FormatDate UDFpegged only ONE CPU core on my laptop! " (Page 194-summary)
@@ -3,7 +3,7 @@ date: "2014-05-19T00:00:00Z"
tags:
- sql-server
title: "Eliminate Overlapping Dates"
slug: "Eliminate Overlapping Dates"
slug: "eliminate-overlapping-dates"
---

I was looking for an efficient way to eliminate overlapping days when provided with a historical table that provided events that could overlap. In my case, I had dates show the range of a process. However, the multiple start and end dates could overlap, and even run concurrently. To eliminate double counting the days the process truly was in play I needed a way to find eliminate the overlap, and eliminate duplicate days when running in parallel. I researched ways to complete this and found the solution through this post. [Solutions to Packing Date and Time Intervals Puzzle ](http://sqlmag.com/blog/solutions-packing-date-and-time-intervals-puzzle)
@@ -13,3 +13,4 @@ Itzik provided an excellent solution, though I had to take time to digest. The o
![Example of Problem and Solution with Overlapping Dates](/images/Eliminate_Overlapping_Dates_ogww1m.png)

{{% gist 8c7235ecb75bb91833e1 %}}

@@ -3,9 +3,10 @@ date: "2014-05-19T00:00:00Z"
tags:
- sql-server
title: "Finding Groups - Consecutive Months"
slug: "Finding Groups - Consecutive Months"
slug: "finding-groups-consecutive-months"
---

A step by step explanation on one way to get a consecutive period of months, which could easily be adapted to days, years, or other values. I'll continue on this track and post a tutorial on eliminating overlapping dates soon.

{{% gist e613ff857b5ae3ad9167 %}}

@@ -3,9 +3,10 @@ date: "2014-08-11T00:00:00Z"
tags:
- sql-server
title: "Snippet Alert: Useful dates (eom, bom, etc)"
slug: "Snippet Alert: Useful dates (eom, bom, etc)"
slug: "snippet-alert-useful-dates-(eom,-bom,-etc)"
---

Common date values you may need to reference that you may not want to write from scratch each time.
{{% gist 5390417 %}}
Hope this helps someone else!

@@ -3,11 +3,12 @@ date: "2014-08-12T00:00:00Z"
tags:
- sql-server
title: "Generate Random Date With Starting Point"
slug: "Generate Random Date With Starting Point"
slug: "generate-random-date-with-starting-point"
---

If you want to create sample random samples when dealing with date calculations to test your results, you can easily create a start and end point of randomly created dates. This is a snippet I've saved for reuse:

`DATEADD(day, (ABS(CHECKSUM(NEWID())) % $Days Seed Value$), '$MinDate$')`

This should let you set the starting point (Min Date) and choose how far you want to go up from there as a the seed value. Ie, starting point 1/1/2014 with seed of 60 will create random dates up to 60 days outside the min date specified. [Stackoverflow Original Discussion: How to update rows with a random date asked Apr 27 '09](http://stackoverflow.com/questions/794637/how-to-update-rows-with-a-random-date)

@@ -3,9 +3,10 @@ date: "2014-12-02T00:00:00Z"
tags:
- sql-server
title: "Get Information on Current Traces Running"
slug: "Get Information on Current Traces Running"
slug: "get-information-on-current-traces-running"
---

This is just a quick informational query to save as a snippet to get some quick information on running traces, and provide the stop and close snippet quickly if you want to stop a server side trace you created.

{{% gist 2f0c53641421a9825e6b %}}

@@ -3,7 +3,7 @@ date: "2014-12-11T00:00:00Z"
tags:
- sql-server
title: "OR pattern causing indexing scans in parameter based queries"
slug: "OR pattern causing indexing scans in parameter based queries"
slug: "or-pattern-causing-indexing-scans-in-parameter-based-queries"
---

#Tl;dr
@@ -34,3 +34,4 @@ However, the stored procedure is not passing in the actual value after the first
However, when result sets can greatly vary, the problem of parameter sniffing can become a problem. In addition, if the OR statement is utilized as my original problem mentioned, the optimizer can decide that since parameter value is unknown at this time, that with an OR clause it would be better to run a table scan since all table results might be returned, rather than a seek.

To bypass this, there are various approaches, but all are a compromise of some sort. The common approach to resolving if truly various selections may be made (in the case of SSRS reports for example) is to utilize option(recompile). This provide the actual value back to the compiler at run time, causing higher CPU usage, but also ensuring the usage of indexes and reducing scans when the columns are properly indexed. Again, this is one solution among several, which can include building dynamic query strings, logic blocks, and other methods.

@@ -34,3 +34,4 @@ Opening the properties of a file allow one to futher edit the actions the applic
Lots of functionality in the catalog to benefit from, but time is limited, I'm going to visit further in next post.

_note: was given a license by developer to help me evaluate long term. This did not affect my review, as it wasn't solicited at all by XYPlorer developer._

@@ -4,8 +4,9 @@ slug: scope-of-global-temp-tables
tags:
- sql-server
title: "Case of the Mondays... causing me to randomly redefine the Scope of Global"
slug: "Case of the Mondays... causing me to randomly redefine the Scope of Global"
slug: "case-of-the-mondays-causing-me-to-randomly-redefine-the-scope-of-global-temp-tables"
temp tables
---

Today, I was reminded that global temp tables scope lasts for the session, and doesn't last beyond that. The difference is the scope of the global temp allows access by other users and sessions while it exists, and is not limited in scope to just the calling session. For some reason I can't remember, I had thought the global temp table lasted a bit longer. Remembering this solved the frustration of wondering why my adhoc comparison report was empty..... #mondayfail [SQLMag article I referenced](http://goo.gl/FCs8lv)

Oops, something went wrong.

0 comments on commit ba09ee6

Please sign in to comment.
You can’t perform that action at this time.