Viewing 15 posts - 1 through 15 (of 33 total)
The first way I can think of to even come close to emulating this behavior in SQL Server is to use REPLACE() to remove any characters that are NOT in...
December 17, 2014 at 10:57 am
There are many ways to approach this. 🙂
If foo returns more than fob, you could try turning my inner join into a left outer join. That will give you NULL...
October 31, 2014 at 12:37 pm
You have a lot going on here. I'll attempt to fix your code.
A little CTE magic, a little bit of join, some group by clarification, and voila!:
with foo as (
--GET...
October 31, 2014 at 10:40 am
You can only have one FROM in your query. I believe you'll want your SUM(Overig) up above the first FROM. You may have to do SUM(fob.Overig) as well.
October 31, 2014 at 9:52 am
You can simulate this with dynamic SQL - it's messy, but it works.
with Desired_Columns as (
select s.name as SchemaName
, t.name as TableName
...
October 30, 2014 at 12:36 pm
You're pretty much looking at some kind of control table for that purpose, unless you have some way of controlling it in the application. Triggers won't work for this due...
October 30, 2014 at 11:52 am
What I'll sometimes use as a poor man's tally table (we don't have one) is to combine ROW_NUMBER() and TOP from some existing table that has enough records to do...
October 30, 2014 at 11:28 am
The nice thing about INCLUDE is that it doesn't matter what order the included columns are in. You could spend a long time tweaking your index based on logical reads......
October 30, 2014 at 8:44 am
In addition to the above advice, you should check out http://statisticsparser.com, which will summarize the output for you. It's really handy for when you're using statistics IO to check you...
October 30, 2014 at 8:15 am
The solution to this is messy, but not too technically difficult.
select Username
, case
when (select max(choice) from (
...
October 28, 2014 at 2:50 pm
Hmm... I think I've finally got this one figured out (my initial thought of EXISTS would be been much messier!). Let's see:
-- First, find out how many qualifications
-- a given...
October 28, 2014 at 2:35 pm
I think this would be a good place to make use of EXISTS.
For B, should there be an EmployeeID in there?
October 28, 2014 at 12:53 pm
There are so many variables to this that it's hard to know where to start.
Different server hardware? Differences in Max Degree of Parallelism/Cost Threshold for Parallelism? Are your statistics being...
October 28, 2014 at 7:05 am
Eirikur Eiriksson (10/26/2014)
October 27, 2014 at 7:00 am
It sounds to me like you're looking for cases where you have rows with both values for that given date? Here's how I would do that:
SELECT
...
October 24, 2014 at 10:14 am
Viewing 15 posts - 1 through 15 (of 33 total)