LessThanDot Site Logo

LessThanDot

A decade of helpful technical content

This is an archive of the posts published to LessThanDot from 2008 to 2018, over a decade of useful content. While we're no longer adding new content, we still receive a lot of visitors and wanted to make sure the content didn't disappear forever.

Another solution for my caching problem with servicestack.text, dapper and sql server.

Introduction My problem is the speed of the datastore I am querying. I won’t name the vendor but their API is horrible. If I want to get all 3000 objects of a certain type I need to first get all the Id’s from the latest versions of those objects, then I have to get the properties of each of those objects, if I am unlucky those objects have subobjects and then I have to query those too.

Read More...

SQL Server 2012 Business Intelligence Whitepaper and Data Tools released

If you are into Business Intelligence, you are in luck, this week Microsoft has released a SQL Server 2012 Business Intelligence whitepaper as well as SQL Server Data Tools – Business Intelligence for Visual Studio 2012 (SSDT BI) templates. The whitepaper is 41 pages and covers Microsoft BI Authentication and Identity Delegation . Here are the contents of the whitepaper Contents Introduction Personal BI Scenarios in Excel

Read More...

Direction of Intelligent Computing

Over the last few months, something has been sticking me in the left side of my brain as it pertains to computing and the overall feel to where we are in computing. This came about in some great conversations during the recent MVP Summit and sparked this article. The stick twisting around in there is: Is computing going the direction we need it to? Wow, that’s a question that has petabytes worth of responses that can lead to nowhere of a direction or conclusion.

Read More...

Use the sp_describe_undeclared_parameters stored procedure to check if dynamic SQL has undeclared parameters

Sometimes you get some dynamic SQL handed to you which is 2 pages long with all kind of parameters. Of course you yourself would never write such a monstrosity, but how can you verify that all parameters in the code have been declared? Let’s say you have the following piece of dynamic SQL DECLARE @DynamicSql nvarchar(1000) SELECT @DynamicSql = N'DECLARE @Type nchar(3) = ''P'' SELECT * FROM master..spt_values where type =@Type' exec( @DynamicSql ) That will execute just fine.

Read More...

Standardize Table Aliases

What’s wrong with the following code? SELECT a.[BusinessEntityID] , b.[FirstName] , b.[LastName] FROM [HumanResources].[Employee] a INNER JOIN [Person].[Person] b ON b.[BusinessEntityID] = a.[BusinessEntityID] Nothing – except for my poor choice of using meaningless single characters as table aliases. Although it’s not a big deal with simpler queries like I’ve here, it can be a maintenance nightmare with complex queries that join multiple tables. What about now? Is there anything wrong still?

Read More...

SSMS – Enabling Ctrl+R Shortcut to show or hide query results/messages pane

Do you use Ctrl+R to hide or display the query results/messages pane in SSMS? Have you installed SSMS 2012 and find that it does not work? Does it drive you crazy because you think they pulled keyboard shortcut or because in some installs it works but not in others? Fear not, you can add this keyboard short-cut! In SSMS open the “Tools” menu and choose “Options…”. On the left, expand “Environment”, then expand “Keyboard” and then click on “Keyboard”.

Read More...

Giving only insert permissions to a table for a new login

There was a requirement to create a new user who would have only insert permissions to one table, this user would also have insert and select permissions to another table. This is pretty simple to accomplish. First create this simple database with two tables CREATE DATABASE TestPermission GO USE TestPermissions GO CREATE TABLE TestAccess(id INT) INSERT TestAccess VALUES (1) GO CREATE TABLE TestAccess2(id INT) INSERT TestAccess2 VALUES (1) GO Create the new user

Read More...

Column name or number of supplied values does not match table definition when dealing with temp tables

The other day I was doing some testing and then from the same connection I executed a stored procedure only to be greeted with the following message Msg 213, Level 16, State 1, Procedure prTestTemp, Line 5 Column name or number of supplied values does not match table definition. I looked at the proc, hasn’t changed in months, I decided to run it from a different window and no problem. I took me a couple of minutes to realize what was going on.

Read More...

Redis and VB.Net

Introduction So I thought I needed redis to do some much needed caching for an app I am writting. And I was right, as I often am. So I installed redis and used the .net redis client from the always brilliant Demis Bellot. Redis is a key-value database, a dictionary on steroids. It is great for caching. And it is fast at what it does by keeping most things in memory.

Read More...

Pesky resolutions, the two month checkup

It has been two months since I posted my resolution for 2013, you can find that post here: Ah yes, those pesky resolutions. Today I decided to take a look at how I am doing two months into the year. Read more technical books I only read one technical book so far, this book is The Well-Grounded Java Developer: Vital techniques of Java 7 and polyglot programming. I have reviewed the book here: Review of The Well-Grounded Java Developer.

Read More...