Viewing 15 posts - 586 through 600 (of 1,347 total)
>>Your query to test using UNIONs produces syntax errors:
Indeed it does. Fix the 3 Case expressions and add the "End" keywords that I forgot:
Case When m.Customer Is Null Then...
February 14, 2006 at 11:09 pm
How about you run this query and post the results.
It builds a derived table of all the Customer Numbers you're including, then it takes that set and LEFT JOINs it...
February 14, 2006 at 4:33 pm
>>Are the singlet indexes redundant and unnecessary? Is there a definitive answer to that question?
There is no definitive answer, because it depends on the distribution of data in the table/indexes,...
February 14, 2006 at 3:16 pm
Maybe it's time to post some DDL for the tables involved.
There are 3 tables, each with a customer or customernumber column. Are they the same datatypes ?
February 14, 2006 at 2:31 pm
What is the purpose of the 1st recordset (TempRS), if the SQL that is executed does not return a recordset ?
Why do you need a #temp table when this can...
February 14, 2006 at 2:05 pm
Try removing the blank line betwene your JOIN and WHERE so that SQL knows where the batch ends ?
February 14, 2006 at 1:18 pm
>>Should this field be indexed in order to maximize performance?
Answer is: "it depends".
Factors to consider:
- What is the data distribution in the table
- Will the index be unique or non,...
February 14, 2006 at 11:58 am
What you are seeing are multiple threads being spawned to process in parallel.
You can try providing the MAXDOP query hint to prevent use of paralellism to see if it improves the...
February 13, 2006 at 10:29 pm
>>Incorrect syntax near the keyword 'THEN'.
Why are you puzzled ? The error tells you exactly what is wrong. Incorrect syntax.
Look up IF in books online, View the example code. The...
February 13, 2006 at 12:50 pm
You can't assign a multi-column result set into a single variable. General syntax is:
SELECT
@Var1 = Column1,
@Var2 = Column2,
...
@VarN = ColumnN
FROM
WHERE etc
February 13, 2006 at 12:47 pm
So, you have to handle overlapping and non-overlapping periods ?
Since your granularity is to the minute, I would build a table containing all workable minutes in the day - this would...
February 13, 2006 at 9:56 am
How can 1 person work on 2 physically separate cars at the same time ?
Is this why I get billed so much for "labor" when I get my car serviced...
February 13, 2006 at 9:10 am
For problems like this, you generally need to join to a derived table (note, not a sub-query), where the derived table introduces a column that resolves to just 1 row....
February 10, 2006 at 2:25 pm
>>DELETE FROM tblAPData AS d
If using a tablename and alias, you have to explicitly delete from 1 of them before the FROM keyword:
DELETE d
FROM tblAPData AS d
WHERE EXISTS
(SELECT t.* FROM...
February 10, 2006 at 2:14 pm
>>I'm curious why you included the test in the JOIN
2 reasons
- Code readability/maintainability
- Performance & index usage
Maintenance: Consider if there was more than 1 column being filtered on, in...
February 10, 2006 at 1:42 pm
Viewing 15 posts - 586 through 600 (of 1,347 total)