Viewing 15 posts - 301 through 315 (of 7,168 total)
If you want to ensure no duplicates enter the table then you should declare your IDENTITY column to be unique either as the primary key or with a unique index...
February 7, 2016 at 9:47 am
I wonder sometimes if SQL Server needs a reboot. In a lot of places its Sybase roots are still showing (e.g. CONVERT, DECIMAL/NUMERIC, UPDATE...JOIN, @@, etc.). The need to maintain...
February 6, 2016 at 7:24 pm
what we want are the supporting objects that will help us run your code on our machine. make it easier for us to help you.
February 6, 2016 at 6:21 pm
Arrgh, so ignore my last set of results. I was not comparing apples to apples. I just ran all three with the indexes I built and while my solution continues...
February 6, 2016 at 3:50 pm
Thanks for the test-harness Jacob! I think I managed to remove one use of LAG from my query (and still attain the correct result) and it seems to have dramatically...
February 6, 2016 at 10:01 am
Please post DDL (CREATE TABLE) including indexes and constraints and DML (INSERT INTO) statements to allow us to create a test area on our side.
February 5, 2016 at 2:11 pm
OK, I'll go with it...
This query has a lower plan cost than the other two solutions that seem to satisfy the requirements (Jacob's and Drew's) but I haven't tested...
February 4, 2016 at 3:12 pm
ssc_san (2/4/2016)
@jacob Wilkins - You are correct, if there are two or more MtchId's with "Phone", "Online" and other OrdLoc's I want to display only...
February 4, 2016 at 2:21 pm
I see what you are pointing out now, that before we decide to return an online order we must first know there was a phone order for that OrdID. Sounds...
February 4, 2016 at 7:16 am
Phil Parkin (2/4/2016)
Orlando Colamatteo (2/3/2016)
removed silly post...Your own, presumably? 🙂
Yeah, just some misplaced humor I didn't want mistaken for something that might take away from this thread. This written stuff...
February 4, 2016 at 6:31 am
This one seems to do quite a bit better than the others on elapsed time:
with cte as (select distinct OrdID
...
February 4, 2016 at 2:15 am
Jacob Wilkins (2/3/2016)
February 4, 2016 at 2:12 am
CRMUK (2/3/2016)
What about production support, ETL or other backend activities? Never is a tough standard to live up to.
Very true..
I did amend the insert value as suggested.
Many thanks
Great, now show...
February 4, 2016 at 1:46 am
CRMUK (2/3/2016)
select @recordid = recordid from inserted
The OP will find out soon enough what the problem is when they attempt their trigger with more than 1 row :w00t:
Thanks for...
February 3, 2016 at 10:36 pm
Here is an option that I think does a little less work but I am still not crazy about needing to use row_number. I think there is still a better...
February 3, 2016 at 10:10 pm
Viewing 15 posts - 301 through 315 (of 7,168 total)