5
votes
3answers
336 views
4
votes
1answer
40 views

SEDE query to find users with exactly one post in a particular tag

I'm doing some research for a meta post on Gardening.SE (where I'm a pro tempore moderator). I'm using the Stack Exchange Data Explorer (SEDE) to find information about first time users who post ...
3
votes
4answers
2k views

Inner join with first result

In SQL Server, there is two tables: Houses, and their images. I need a list with 20 houses with the first of their images (only one). I tried: ...
3
votes
2answers
871 views

Which SQL statement is faster

My co-worker claims that using a parameterized Like statement is equivalent to dynamic sql and won't have its execution plan cached for reuse. He says that using ...
3
votes
2answers
127 views

Please, help to optimize this query

ms sql server 2008 tables description http://postimage.org/image/1tv83azz8/ ...
3
votes
1answer
103 views

Query too slow - Optimization

I am having an issue with the following query returning results a bit too slow and I suspect I am missing something basic. My initial guess is the 'CASE' statement is taking too long to process its ...
3
votes
1answer
122 views

Querying a warehouse database

Consider the query given below: ...
3
votes
2answers
4k views

SQL Server Split function optimized

I know there are some answers about a user function to split chars and I have one already running (found one years ago in the net and modified it to my own needs). Since I use this function very ...
3
votes
1answer
108 views

SQL view, better way?

I there a better way to write this query? I feel sure it can be done in one statement with joins, but I couldn't get it, and I'm afraid I've made it too slow. What suggestions do you have? I'm ...
2
votes
2answers
427 views

My simple CMS system - security and code obscurity?

I'm working on a simple CMS with the intent of making it as secure as possible (a personal challenge) and the code as clean as possible. I think I've a long way to go so I would appreciate any input, ...
2
votes
2answers
266 views

Subquery v/s inner join in sql server

I have following queries First one using inner join ...
2
votes
1answer
199 views

DAL Efficiency Help

I am attempting my first try at some c#. So far I love it, (not more than vb tho ;)) however, I am wondering if I can make these classes a bit more efficient. Please note ###Test is my attempts at ...
1
vote
1answer
140 views

SQL with several joins

Is this query acceptable in terms of performance (I get the correct data) or can it be optimized? ...
1
vote
1answer
129 views

Stored Procedure calculating employee earnings

I have following stored procedure in a C# win forms application which calculates employee earnings based on attendance as follows. Note that a shift is 12 hours and employees mark attendance for in ...
1
vote
1answer
39 views

SQL iteration-Insertion plus renaming

Base Info Two tables: tData, tData2 Exactly the same columns About 200,000 records SQL Server 2008 R2 Logic At first sight we need to insert tData rows into tData2. What else? We need a ...
1
vote
3answers
588 views

Using a Dedicated Class & Constructor to initialize Stored Procedure for SQL Transaction

I will try to be as concise as I can: The goal: trying to universalize a specific section of a project, that is dealing with the SQL database transactions. To assist you with your answer, I've ...