Viewing 15 posts - 31 through 45 (of 101 total)
Hi
This isn't a perfect solution but it might get you a step closer.
Try a bulk insert. You will need to define your table structure and you will also need...
March 19, 2009 at 2:32 pm
You need to combine GROUP BY and a CASE statement:
select doctor_code, sum(case when patient_code = '0000' then totaltests else 0 end)
from YOUR_TABLE
group by doctor_code
You can add more columns with...
March 17, 2009 at 9:34 pm
Does this union query get you the right results?
SELECT PC.MainProductID AS partnumber, sum(P.ProductWeight * PC.quantity) AS weight
FROM #myparts P INNER JOIN #mycombinations PC ON (P.ProductID=PC.SubProductID)
WHERE ProductType <>7
GROUP BY MainProductID
UNION ALL
SELECT...
March 17, 2009 at 7:49 pm
Sounds like a great outcome - and a boss who is happy to delegate properly!
All the best.
March 16, 2009 at 7:34 pm
There is nothing more annoying than finding a forum post describing the exact problem you have.... but no answer!
Which is exactly what happened to me when I...
March 16, 2009 at 5:19 pm
Just in case anyone else ever hits this problem, the solution is to add a row near the top of the worksheet that contains your maximum string length. In...
March 16, 2009 at 4:28 pm
I've been in a similar (though not quite as messy) situation as the one you described.
If I was in your situation then I would be very keen to...
March 15, 2009 at 3:44 pm
Jeff Moden (3/9/2009)
Bevan keighley (3/9/2009)
Select t3.ID From #TEST t3 Where t3.COUNTRIES in ('AU', 'IN')
except
Select t3.ID From #TEST t3 Where t3.COUNTRIES not in ('AU', 'IN')
Looks slower based...
March 10, 2009 at 1:45 pm
or slightly fast if there is a clustered primary key on ID and countries...
Bevan
March 9, 2009 at 9:30 pm
Or this works as well:
Select t3.ID From #TEST t3 Where t3.COUNTRIES in ('AU', 'IN')
except
Select t3.ID From #TEST t3 Where t3.COUNTRIES not in ('AU', 'IN')
Looks slower based on execution plan but...
March 9, 2009 at 9:15 pm
If you want to exclude those ID's that have other countries besides AU and IN then use this:
SELECT ID
FROM TEST
WHERE ID IN (Select t2.ID From TEST t2 Where t2.COUNTRIES='AU')
AND COUNTRIES...
March 9, 2009 at 9:11 pm
Use default values for your parameters and then check if any have been changed...
The following is untested but will give you an idea:
Create Procedure proc1
@p1 int =1,
...
March 4, 2009 at 9:09 pm
The monotonically increasing requirement comes about because when you are adding rows to a table, you do not want to be attempting to add them to database pages that are...
March 4, 2009 at 8:50 pm
There are probably quite a few opinions out there as to what is best and to be honest it really depends on your particular business circumstances.
The things I take into...
March 4, 2009 at 8:19 pm
veena (3/2/2009)
hi,thank you for replying....
For Some reason i want to Store TableA id in TableC....
Plz Tell me Whether i can do this in a database where Normalization rules are applied?
regards
veena
Well......
March 3, 2009 at 8:34 pm
Viewing 15 posts - 31 through 45 (of 101 total)