I discovered this little beauty the other day, SSMS Tools Pack for Microsoft SQL Server Management Studio from a developer in Slovenia. I haven’t had a chance to make use of everything in the package yet but so for it has been pretty neat. The Query Execution History has been pretty handy.


From the website:

SSMS Tools Pack is an add-in for Microsoft SQL Server Management Studio (SSMS) 2005, 2008, 2008 R2 and their respective Express versions.
It contains a few upgrades to the SSMS IDE that I thought were missing.




Get it here – http://www.ssmstoolspack.com/

This topic came up at work a while ago when trying to perform database operations on strings containing a trailing space.

The Problem: One of our stored procedures was using CHARINDEX to search for strings within the database. The problem appeared when a user defined a search parameter containing a trailing space and the results of the search were not as expected.

SQL and Trailing Blanks

(From the section “Comparison operators, listed” in SQL help)

Trailing blanks are ignored in comparisons; for example, these are equivalent:

This is an interesting article: INF: How SQL Server Compares Strings with Trailing Spaces

Sort of related but actually about how data is stored is the ANSI_PADDING setting:


Display Trailing Space in Clarion

The Clarion entry control and text control don’t appear to be able to show trailing spaces from data in a database. You can enter trailing spaces in an entry or text control and save the data but next time you view or edit the form those trailing spaces are not shown.

Funnily enough, if the data does have trailing spaces and the field is not edited then the trailing spaces remain intact when the form is saved.

Fun with SELECT Statements

Have a play with the following SQL to see some examples:

Note the use of “LIKE” rather than “=” and the “[^ ]” will force the WHERE to only match items without the trailing space.
Also, try setting the ANSI_PADDING to “OFF” and see the difference in the results.

So there are a few thoughts and discoveries that came up in the course of investigating this issue. Of course once you know the reasons there are ways to workaround the problems but I will leave that up to your individual scenario…

I was discussing this with a colleague yesterday and thought everyone might be interested in the outcome.


I was getting an error “There is already an object named ‘PK_SUPPLIERPRODUCTID’ in the database.” when trying to create a temp table.


  • A temp table (‘#Temp’ & Thread()) was created initially in a window procedure on thread 2.
  • That window was then closed and later opened on a different thread number e.g. 3.
  • When the CREATE TABLE is called the second time I was getting the above error.