Viewing 15 posts - 871 through 885 (of 7,597 total)
SELECT ca.*
FROM dbo.your_table_name
CROSS APPLY (
SELECT Sector, 2023 AS Period, [2023] AS Value
UNION ALL
SELECT Sector, 2024,...
May 11, 2022 at 2:37 pm
Check to see if the tool has some type of api or other interface that will let you get the SQL from the tool itself.
May 5, 2022 at 6:31 pm
SELECT *,
SUM(tran_in - tran_out) OVER(PARTITION BY account_id ORDER BY Year_cal, Month_Cal
ROWS BETWEEN UNBOUNDED PRECEDING...
May 5, 2022 at 3:29 pm
... ,PercentOfWhole = CONVERT(DECIMAL(3,1),StatusCount*100.0/SUM(StatusCount) OVER ()) ...
I believe you want decimal(4, 1) rather than (3, 1) (at least I can't see any reason why 100% of one group might...
May 4, 2022 at 5:39 pm
There is no such thing of any kind built into SQL Server.
April 29, 2022 at 3:45 pm
If you just want to get rid of all digits in the email address, then:
REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(email_id, '0', ''), '1', ''), '2', ''), '3', ''), ...
April 29, 2022 at 3:44 pm
Most likely, SQL detected that fewer rows would be returned and therefore changed how it would access those tables based on row estimates. If the row estimates are off, SQL...
April 29, 2022 at 3:42 pm
You need to look at your stand-alone (non-proc) query again. It seems to have an INNER JOIN rather than a LEFT JOIN, at least according to the query plan.
April 28, 2022 at 1:47 am
Maybe it will. SQL can pre-fetch data. It depends on the specifics of the situation, including your edition of SQL Server.
April 27, 2022 at 8:24 pm
Since TRUNCATE is more efficient, try it first.
If it doesn't work, then use DELETE.
April 27, 2022 at 8:23 pm
STRING_AGG isn't available before SQL 2016, right?
Select T1.Itemcode,T1.name ,
stuff((select ', ' + docno
from [order]...
April 27, 2022 at 3:30 pm
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
Viewing 15 posts - 871 through 885 (of 7,597 total)