Problem I’m trying to find the occurrences of strings in view B in a string in table A. However, the […]
Tag: sql-server
Optimize query containing too many inner join and rows
Problem I have the following query: SELECT * INTO ##TempStaffT FROM Staff HF WHERE HF.[businessline_id]=’T’ AND HF.[offices_id] IN (SELECT * […]
Speeding up a stored procedure
Problem Is there any way to optimize this stored procedure? Maybe something instead of so many joins? It takes some […]
Web Server handler class to pass IIS http requests to SQL Server stored procedures
Problem This is a c# class I use to implement web database applications with Microsoft IIS and Microsoft SQL server. […]
Query to get distinct items at the top of results and duplicates following
Problem I need to query the table below and list the distinct items at the top of my result set […]
Splitting a string in an SQL query
Problem BudgetCode is in the format ‘xxxx-yyyyy-zzzzz’. This splits it correctly but I think that there has to be a […]
Update user country based on IPv4 decimal address
Problem I have UserSignatures, a table with clientIPs, some of which have CountryIds that are null and need to be […]
Update column based on input variable in stored procedure
Problem The purpose of the below code is to update a column based on the name of the field name […]
The use of database “sets” rather than “functions”
Problem I’ve currently got a MSSQL stored procedure that uses multiple SQL functions to achieve a number of returns. Now […]
SQL subquery to determine whether or not a particular row is the first item that matches the subquery
Problem Here is my VB.NET and SQL query (which is one of the things I’m particularly interested in having critiqued): […]