Viewing 15 posts - 1,936 through 1,950 (of 7,614 total)
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
No. SQL doesn't really care which proc is using the index, and even trying to capture that kind of data about index usage would be huge overhead. Indexes need tuned...
January 27, 2021 at 6:02 pm
Do you pre-restore the full backup each time to speed up the next restore? (Assuming you have the disk space available -- and if not, you can get the space...
January 26, 2021 at 4:40 pm
@@TRANCOUNT itself is fine, I think. Does UPDATE increment and decrement @@TRANCOUNT as it processes?!
CREATE TABLE #foo (i INT NOT NULL);
INSERT INTO #foo(i) VALUES (0);
SET NOCOUNT ON;
SELECT...
January 26, 2021 at 3:17 pm
How large is the log file? The disk area for a log file must be preformatted, whereas data files do not (assuming you have IFI activated, which is standard now).
Do...
January 26, 2021 at 3:04 pm
You would do that with view(s). The ENCRYPT / DECRYPT would be only within the view(s).
The users don't have to query anything different, as you can make the original table...
January 25, 2021 at 7:44 pm
You're welcome! I'm glad it helped. Interesting q to play with.
January 25, 2021 at 7:38 pm
Maybe something like this?:
SELECT Item, Date1, Date2, Date3
FROM @headerTable
UNION ALL
SELECT
Item,
CAST(MAX(CASE WHEN week# = 1 THEN Quantity END) AS varchar(10)),
...
January 22, 2021 at 6:13 pm
Yeah, this can be definitely done in a standard SELECT.
Do you want to show only the weeks that had a match or do you want to show all 52 weeks,...
January 22, 2021 at 5:58 pm
I'm confused about a couple of things.
First, why do you only want to INSERT "field3" (really column3)?
There's no link or association to #FieldValues. Surely there must be some columns missing...
January 21, 2021 at 7:56 pm
Viewing 15 posts - 1,936 through 1,950 (of 7,614 total)