Never really enjoyed reading through the statistics IO results, as it makes it hard to easily guage total impact when you have a long list of tables.
A friend referred me to: http://www.statisticsparser.com/
This site is great! However, I really don't like manually copying and pasting the results each time.… Read more
There are probably a common number of apps you pull up when you pull up your system. For example, I pull up my Trello board, outlook, XYplorer, Sublime text 3, Sql server management studio, and ketarin (app updater).
Found that you can easily setup a simply alias and launch a… Read more
Why does this not have more recognition? In the experimentation of various file management and launching apps, I've tried several (Launchy, Listary, etc), but none have offered the speed and customization of Find and Run Robot. This app is a life saver for the power user!
Here is an example… Read more
#Tl;dr article (time constraints prevented me from reworking significantly)
An article on SQL-Server-pro was forwarded over to me to research by a friend who indicated that using a variable with an or pattern had historically caused table scans. This was a suprise to me as all previous queries with optional… Read more
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… Read more
currently on version 14.60
I'm a big fan of finding tools that help automate and streamline things that should are routine actions.
Suprisingly, I've found it incredibly challenging to move away from the default Windows Explorer for file management, as the familarity it offers makes it somewhat tough to be… Read more
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.
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… Read more
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:
language-sql DATEADD(day, (ABS(CHECKSUM(NEWID())) % $Days Seed Value$), '$MinDate$')
This should let you… Read more
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.
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.… Read more
Renaming all references inside stored procedures and functions can be migraine worthy without a little help…
If you run across migrating or copying a database structure for some purpose, yet need to change the database references or some other string value inside all the procedures and functions to point to the newly named object, you are in for a lot of work!
I built this procedure… Read more
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.
If you have a keyword selected and want… Read more
If you have a set of columns inside your table that you want to allow nulls in, however if one of the columns is updated force all columns in the set to be updated, use a check constraint. In my case, I had 3 columns for delete info, which were… Read more
SSMS 2012 Extender for the times you want some organization to the random pile of objects gathering in the dusty confines of that database
When dealing with large amounts of objects in a database, navigation can be tedious with SSMS object explorer. This extender organizes the objects into groups based on schema, helping a developer easily navigate to the appropriate object. The current version didn’t work for views, but the other objects were grouped… Read more
Quick snippet I put together for reviewing basic info on database users/principals, permissions, and members if the principal is a role.
/******************************************************* Some Basic Info on Database principals, permissions, explicit permissions, and if role, who is in this role currently *******************************************************/ ; with roleMembers as ( select drm.role_principal_id ,dp.principal_id ,dp.name…
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… Read more
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.
select database_name = db_name() ,object_schema_name = object_schema_name( object_id ) ,object_name = object_name( object_id ) ,full_object_name = object_schema_name( object_id ) +…
For sake of future generations, let’s begin to reduce typing and reuse code we’ve built. I think we can all agree that TSQL statements are often repeated. Ideally, snippets should be created to reduce repeated typing and let us focus on logic and content. However, some statements may not really… Read more