Viewing 15 posts - 1 through 15 (of 2,617 total)
SELECT T1.UNIT,
T1.DATE,
CASE WHEN COUNT(T1.PRICE) OVER (PARTITION BY T1.UNIT ORDER BY T1.DATE ROWS BETWEEN...
December 28, 2024 at 9:41 pm
You need something like this:
DECLARE @var1 nvarchar(30);
SET @var1 = 'Database1';
DECLARE @sql nvarchar(max);
SET @sql = '
USE ' + QUOTENAME(@var1) + ';
-- Add the rest of your script below:
SELECT...
December 24, 2024 at 3:06 pm
First, you need to correct the query to use the alias in the UPDATE, not the original table name.
Does that actually make any difference?
December 11, 2024 at 7:43 pm
I have query which is filling TEMPDB
I need suggestion how to modify this query to which can minimize the TEMPDB space to fill
update #TempShow1 set Name = case...
December 11, 2024 at 6:11 pm
The day my bank starts using NOLOCK
on its SQL Server queries is the day I start ROLLBACK TRANSACTION
on my account and JOIN
a new bank.
December 9, 2024 at 2:29 am
I've changed table [dbo].[CostKeyDeletes]
. There is no need for and ID and CostKey
should be the clustered index. I've added an extra column to show if the CostKey
has been...
December 7, 2024 at 1:41 am
Hi Bruin,
Thanks for your question! Could you start a new thread and include the table definitions (DDL), details of any indexes, and explain exactly what you need the cleanup to...
December 6, 2024 at 5:27 pm
Since you say the updates are not "extremely frequent", it's mostly an "Insert" index by TenantID. It's a Type 98 Index and since there aren't a large number of...
November 21, 2024 at 2:51 am
Hi Jeff
Thank you for the detailed explanation and advice on Fill Factor settings. It is incredibly helpful.
In our case, the clustered index (TENANTID, ID) will likely see updates to rows...
November 20, 2024 at 10:25 pm
post to get new page
November 20, 2024 at 2:49 am
Jeff,
Have you got any recommendations for the fill factor when I create the new clustered primary keys on (TENANTID, ID)?
Where ID is an identity column on the table.
November 20, 2024 at 2:00 am
Does partitioning by TENANTID improve query performance when most queries are filtered by tenant? For instance, will partitioning reduce the amount of data SQL Server scans, or is...
November 20, 2024 at 1:58 am
Nice.
Also, you don't have to change the FKs in other tables if you need one for just ID. Instead, just add a unqiue nonclus index on ( ID );...
November 20, 2024 at 12:01 am
I've created a stored procedure that takes a table name as a parameter and checks the clustered index column order. If the order is ID, TENANTID, the procedure drops the...
November 19, 2024 at 11:49 pm
Currently deleting using by day
WHERE SpoolStartDt = '2022-09-30 00:00:00.000';
How could I delete a MONTH at a time..
Thanks.
Using YEAR and MONTH Functions:
INSERT INTO #ToDelete (Id)
SELECT Id
...
November 17, 2024 at 9:54 pm
Viewing 15 posts - 1 through 15 (of 2,617 total)