Viewing 15 posts - 31 through 45 (of 6,751 total)
Rather than a CASE, use the built-in REPLICATE function:
DECLARE @MAX_naam AS varchar(MAX)
SET @MAX_naam = 22 --(SELECT SUBSTRING(MAX(naam),LEN(MAX(naam))-1,LEN(MAX(naam))) FROM incident); -- = 22
DECLARE @maxnaam_length AS int =...
April 26, 2022 at 9:30 pm
I know a little bit of Sql but not about this topic.
Ah, but this is a SQL Server forum. Your q is somewhat off-topic here. You might want to...
April 26, 2022 at 6:29 pm
Right, because reorganize only ever needs 1 extra work page, the in_tempdb option is really meaningless for reorg.
April 25, 2022 at 7:22 pm
SELECT SubmissionGuid
FROM #Subs
GROUP BY SubmissionGuid
HAVING MAX(CASE WHEN QuoteStatus = 1 THEN 1 ELSE 0 END) = 0
April 25, 2022 at 7:20 pm
To avoid using the user db for index rebuild work space, look into specifying SORT_IN_TEMPDB = ON as part of the index REBUILD. This is especially true if you have...
April 25, 2022 at 5:42 pm
I'll assume you have an existing clustered index on the table. If you do, most likely you'll want to use a clustered columnstore index instead. To do that, follow these...
April 25, 2022 at 5:31 pm
For best performance, make sure you have the log table properly clustered. Specifically, if you intend to delete by log time, as is quite typical, then cluster the table that...
April 25, 2022 at 2:55 pm
Rather than adding a month and taking away a day to get the end of month (which is how I have always done it) there is a function called...
April 22, 2022 at 8:03 pm
I suspect there's some way to do this without recursion, but for now, here's a method using recursion.
DECLARE @amount_to_spend decimal(9, 2)
SET @amount_to_spend = 50.00
;WITH cte_products_by_price AS (
...
April 22, 2022 at 8:00 pm
;WITH
cte_tally10 AS (
SELECT * FROM (VALUES(0),(0),(0),(0),(0),(0),(0),(0),(0),(0)) AS numbers(number)
),
cte_tally100 AS (
SELECT 0 AS number UNION ALL
SELECT...
April 22, 2022 at 7:23 pm
I don't think you don't need an explicit COMMIT and ROLLBACK. In SQL Server, by default each SQL statement that modifies data will be in its own transaction.
Specify "SET XACT_ABORT...
April 21, 2022 at 2:41 pm
but my understanding is that the -kill command does not kill connections that are in "Rollback" and unfortunately, we seem to have connections in ROLLBACK.
To the first point, there's...
April 18, 2022 at 6:51 pm
One place to start is reviewing the "Top 10 Avg I/O Queries". See if anything stands out there.
Next I'd review the index stats. Looking particularly at missing indexes and the...
April 15, 2022 at 7:31 pm
ScottPletcher wrote:Didn't you already ask this q?!
According to the OPs profile, no. In fact, this appears to be the first and only question they've posted.
OK. Sorry, my bad, it...
April 15, 2022 at 3:30 pm
Didn't you already ask this q?!
April 14, 2022 at 6:35 pm
Viewing 15 posts - 31 through 45 (of 6,751 total)