Viewing 15 posts - 4,261 through 4,275 (of 7,597 total)
Maybe this:
insert into #mailing
(segment
,contact_number)
select @mailing + RIGHT('0' + CAST(base_value + row_num AS varchar(2)), 2)
,AccountNumber
from (
select distinct AccountNumber, ROW_NUMBER() over(order by AccountNumber) as row_num
...
June 14, 2016 at 8:31 am
I'd make a slight adjustment, since I prefer to check conditions as near to the source as possible, and it might even be slightly more efficient:
SELECT X1,
...
June 14, 2016 at 6:59 am
Eric M Russell (6/9/2016)
Sean Lange (6/9/2016)
Eric M Russell (6/9/2016)
patrickmcginnis59 10839 (6/9/2016)
Eric M Russell (6/7/2016)
Luis Cazares (6/7/2016)
This is what happens when you trust a...
June 10, 2016 at 2:02 pm
GSquared (6/9/2016)
Sean Lange (6/7/2016)
Jeff Moden (6/7/2016)
Eric M Russell (6/7/2016)
They're asking the wrong type of questions for a job interview.
I think it's a great question. It shows whether or not...
June 9, 2016 at 12:17 pm
SQL Server has built-in performance reports that could help you here.
Using SSMS, for the instance that contains the db having the problem:
1) right-click on the instance name
2) select "Reports"
3) select...
June 8, 2016 at 12:50 pm
With just a quick look, I'd do something like below. I tried to follow your naming style, naturally change as needed.
Since we can't guarantee unique ProductNumbers across companies, we'll...
June 3, 2016 at 11:45 am
Dennis Q Miller (6/1/2016)
Stacey Decker (10/30/2014)
June 1, 2016 at 10:53 am
The best clustered index is almost always the single most critical performance factor for a table. You could gain some mild efficiencies looking at other things, but a far,...
June 1, 2016 at 8:01 am
cyp901 (5/31/2016)
Andre 425568 (5/26/2016)
I got fragmentation stats after the Table rebuild and then after index rebuild. Still had a lot of fragmentation.
I believe what Jeff Moden was trying to say...
May 31, 2016 at 1:34 pm
You can use derived tables within the query to provide computed values, you don't need variables.
Also, here's a quick demo to show that you can query from different tables, as...
May 26, 2016 at 2:42 pm
djj (5/26/2016)
ScottPletcher (5/26/2016)
May 26, 2016 at 1:15 pm
For up to 3 accidents total, it's relatively straightforward, with a single table pass for each table -- afaik, beyond 3 would require additional code/complexity (at least one additional join/select...
May 26, 2016 at 12:48 pm
You SET @startdate twice instead of setting @enddate 🙂
..
set @startdate = '01-01-2016'
declare @enddate datetime
set @startdate = '10-10-2016' --should be set @enddate = ...
...
May 26, 2016 at 12:27 pm
If the table structures to be returned are the same for all conditions, you can use UNION ALL with the appropriate WHERE conditions so that only one query ever returns...
May 26, 2016 at 12:24 pm
What is the data type of "[SatisfiedPercentage]"? Because it's also part of the same CASE statement.
May 25, 2016 at 11:12 am
Viewing 15 posts - 4,261 through 4,275 (of 7,597 total)