TechObjects – Blog about helpful Tech Tips/ Notes
-
C# – Splitting CSV/ Looping
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.
-
SQL – With NoLock Hint
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…
-
SQL – Select Issue/ Timing
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…
-
SQL Case Statement
Cases are used to return a specific value (hardcoded or field from the table) based on a condition. Example:
-
Microsoft SQL Server – Limiting Memory Usage
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…