Viewing 15 posts - 136 through 150 (of 747 total)
Check out this article by Jeff Moden: https://www.sqlservercentral.com/articles/cross-tabs-and-pivots-part-1-converting-rows-to-columns-1
June 5, 2023 at 8:23 pm
Maybe something using STRING_SPLIT?
-- e.g.,
SELECT #returned_products.#returned_products_id,CONCAT('reason_',value) AS returned_products_reason
FROM #returned_products
--Assumes reason always in the form "reason_#. Using REPLACE to treat underscore as the delimiter.
CROSS APPLY STRING_SPLIT(REPLACE(#returned_products.returned_products_reason,'reason',''),'_') reasons
WHERE reasons.value...
May 30, 2023 at 3:37 pm
You generally don't need/want to use DISTINCT when you're using an aggregate like COUNT() -- you instead want to GROUP BY the SELECT columns that are not aggregated.
Does that work?...
May 26, 2023 at 8:48 pm
Can you provide DDL & sample data insert script?
You said you want counts, but you're using DISTINCT & you're not returning COUNT()
May 26, 2023 at 7:08 pm
And these AI's should do that efficiently so that their queries don't block other services and users, or exhaust server resources.
May 26, 2023 at 5:02 pm
Adapted from https://www.mssqltips.com/sqlservertip/2960/sql-server-backup-paths-and-file-management/
DECLARE @media_family_id uniqueidentifier = '67BAB2D0-A1DC-44F8-BF73-EBAFD5AE322'
-- File name : Where are the backups.sql
-- Author : Graham Okely B App Sc
-- Scope : OK on SQL Server...
May 25, 2023 at 6:21 pm
Do you have SQL Server Integration Services Projects extension installed?
May 25, 2023 at 1:26 pm
I don't think DB team should create/control/define UI requirements.
The DB team might advise on UI, both from the perspective of guidance based on the data, and for warnings when a...
May 17, 2023 at 3:27 pm
May 9, 2023 at 8:38 pm
You just want to concatenate all the IssueName values? If you don't care about order, you can use STRING_AGG function:
SELECT STRING_AGG(IssueName,',') AS IssueNames FROM dbo.tempIssueRange;
May 9, 2023 at 1:36 pm
Given that you know the from and to time zone (i.e., you know the offset difference), but your values are not datetimeoffset, why don't you just use dateadd()?
May 9, 2023 at 1:16 pm
Maybe something like Monarch? I used a product called Monarch decades ago that sounds like this tool.
There are some industries/groups of customers with more discipline than others, and some...
May 5, 2023 at 8:58 pm
<reference_number> is an element, not an attribute.
May 4, 2023 at 1:16 pm
That error seems to indicate you're not using SQL Server 2022. (Which is probably why DesNorton wrote " (NOTE the extra parameter in STRING_SPLIT)"
Are you on SQL Server 2022? You...
May 3, 2023 at 5:56 pm
Viewing 15 posts - 136 through 150 (of 747 total)