Viewing 15 posts - 31 through 45 (of 2,648 total)
I made some progress. New code:
ALTER procedure [dbo].[RunStoredProcedures]
as
BEGIN TRANSACTION
BEGIN TRY
truncate table dbo.testtable
select 1/0
END TRY
BEGIN CATCH
IF @@TRANCOUNT > 0
ROLLBACK TRANSACTION
RAISERROR('Rollback of stored procedures was successful', 10, 1)...
February 1, 2025 at 8:14 pm
Hi SSC team,
I wanted to leave the answer here just in case anyone else needs it. This works. Only caveat is that you need to use dts.vaiables instead...
January 10, 2025 at 12:15 am
.
January 10, 2025 at 12:15 am
Using SoCal_DBD's data setup:
SELECT sa1.*, sa2.Count
FROM #SampleAppointments sa1
CROSS APPLY(SELECT COUNT(*) Count
...
January 9, 2025 at 5:31 pm
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
Viewing 15 posts - 31 through 45 (of 2,648 total)