Tech Blog

  • I ran into an interesting scenario where SQL Server wasn’t utilizing an index and was table scanning. There was an existing index that it should have already been using. This caused queries to be slow and timeout. To resolve this we added a query hint called “FORCESEEK”. This forces the query optimizer to search for…

  • In C# passing by reference means you are essentially passing where an object is in memory. This means if you modify the object in a separate method then it updates the original object. An example of this is a Dictionary. Passing by reference utilizes the keyword ref or out. Passing by value which is the…

  • This is a quick example of how to split a string into a string array and how to loop through the results. We then combine the results again changing the delimiter.

  • When running a query against a database that is highly available and records can be accessed at any time, I typically use the “with (NoLock)” hint in my SQL statements. This ensures that if I’m accessing the same record as another user that we do not cause a deadlock. NoLock also runs slightly faster because…

  • Running into SQL query issues can sometimes cause issues. One issue ran into today is that a query which was a simple select, but the “where” statement had an “or” in it and it wasn’t wrapped in parenthesis, which caused almost all table records to be returned. This caused the tempdb to fill up. If…

  • Cases are used to return a specific value (hardcoded or field from the table) based on a condition. Example:

  • To limit SQL servers’ memory usage SQL Server has a setting called “Maximum server memory (in MB)”. This setting is used to limit the amount of memory SQL server can use. By default, it can consume all memory and will release memory as other processes open on the system. When multiple instances of SQL are…