Viewing 15 posts - 1,921 through 1,935 (of 7,608 total)
As Jeff Moden as pointed out, for performance reasons, it's likely to best to create a physical tally table (if you don't already have one) to use for this query:
February 3, 2021 at 3:47 pm
I would think this would be the most straightforward way, although it may not be the most efficient way. But it might work just fine for you if...
February 3, 2021 at 3:09 pm
Actually the use of "parent" and "child" predates databases, for example with directories. Parent directory and child directory were very commonly used terms.
As to tables, not every referenced table is...
February 2, 2021 at 10:07 pm
I would think this would be the most straightforward way, although it may not be the most efficient way. But it might work just fine for you if your data...
February 2, 2021 at 3:56 pm
My personal opinion is that this has all the ear-markings of a classic invoice/invoice detail or work-order/work-order detail problem and should be handled as two individual tables rather than...
February 2, 2021 at 1:14 am
Or you could do this 😉
SELECT IDENTITY(int, 1, 1) AS id, A.*,B.*
INTO ##C
FROM A
JOIN B ON X = Y
February 1, 2021 at 8:01 pm
No, there's no direct way to do that.
However, you could use a standard identity column for the second part of the key, and use ROW_NUMBER() to get a sequential number...
February 1, 2021 at 2:20 am
Since you always want to list all recording artists, I'd start at that table. I would think it's possible that info on an album by a new artist might not...
February 1, 2021 at 12:53 am
A common approach to fix that issue in general is to isolate the SUM() in a separate query, so that the later join doesn't increase the total. For example, something...
February 1, 2021 at 12:28 am
Be sure to cluster the table on ( MyDate, $IDENTITY ). The $IDENTITY just insures that the key is unique. That will make the deletes very efficient.
January 30, 2021 at 3:40 am
Yes, it is very important here, to ensure that the nonclus index key is unique.
And, besides, all clustered index key column(s) will always be added to every nonclus index whether...
January 30, 2021 at 3:37 am
I changed to using descriptive variable names. And I added some debugging displays to help you work through any issues. The sample number you provided is failing the test, but...
January 30, 2021 at 3:33 am
Make the nonclus index UNIQUE yourself, don't force SQL to do it for you. This is important for best performance.
And, yes, you should include the DateDeleted in the index. I...
January 29, 2021 at 3:53 pm
I don't think the current method is a bad approach.
You can use a filtered index to identify the rows needing recalculated.
IF the calcs were easy, I guess you could put...
January 29, 2021 at 3:43 pm
Are you genuinely on SQL 2016 or higher?
If so, I think CHOOSE should save you a lot of coding here.
January 28, 2021 at 12:24 am
Viewing 15 posts - 1,921 through 1,935 (of 7,608 total)