Skip to main content
1 vote
1 answer
165 views

Is it possible to pivot OPENJSON data for multiple rows in T-SQL (on SQL Server 2022). I have a case like below, it works fine for single ID (eg. CustID=111). Surely I can go this route processing ...
user1982778's user avatar
0 votes
0 answers
93 views

We have an End-to-End process which loads data into a Landing database. It used to run individual repopulate scripts for each data source in sequence, but that was taking more and more time to the ...
John Hunter's user avatar
0 votes
1 answer
89 views

I'm looking at the Networking settings for one or our Azure SQL servers, and I see some of them are greyed out. Azure Portal shows a message "You can use TSQL to remove or modify greyed out rules....
DinahMoeHumm's user avatar
2 votes
1 answer
87 views

We're using fulltext indexes in current builds of SQL Server and/or Azure SQL - compatibility levels well over SQL Server 2016 or higher, preferably SQL Server 2022 on Azure. While the searching in a ...
DinahMoeHumm's user avatar
0 votes
1 answer
85 views

I have a table valued function called "elara_customer_byname". When I execute SELECT * FROM elara_customer_byname('%Kar%') I get 2 rows, which is incorrect. If I copy the SQL from the ...
Karlton Kemerait's user avatar
-4 votes
1 answer
178 views

I found examples online using a recursive CTE to find all combinations of values that equal one target amount. The database column ledger_amount is DECIMAL(26,6). DECLARE @TARGET_AMOUNT DECIMAL(26, 6) ...
DoctorKennyG's user avatar
-8 votes
1 answer
127 views

Note that it's saved in time datatype. So if I have someone that started work at let's say 5:30 am and ended their shift at 10:00 am Is there faster way than: declare @Shiftstart time; declare @...
asri Allaham's user avatar
0 votes
1 answer
112 views

In SQL Server 2022, is there an aggregate function for doing a bit-wise OR against a particular column? -- Example table, data and output to show the different flags DECLARE @TEST TABLE (FLAGS TINYINT)...
freefaller's user avatar
  • 20.1k
0 votes
0 answers
38 views

I need to extract most keys/values separately, but also to collect the value of the entire 'wms' key into a single field. I am not the most experienced with OPENJSON(), so this is what I came up with (...
Chris Taliercio's user avatar
1 vote
2 answers
126 views

I have a group of tables being updated/replaced by an outside process. I need to add a primary key to make my queries run faster. However, if the column I'm using is nullable, it obviously won't be ...
Johnny Bones's user avatar
  • 8,502
0 votes
0 answers
61 views

On one of our databases, when I attempt to run sp_blitzCache, I receive the error: Error message is: The ''' character, hexadecimal value 0x27, cannot be included in a name. Procedure fails to ...
BMac's user avatar
  • 1
-1 votes
1 answer
67 views

I have two tables related to each other, each with roughly 200M records. CREATE TABLE [dbo].[AS_tblTBCDEF]( [CDEF_SOC_NUM] [numeric](5, 0) NULL, [CDEF_EFF_DATE] [date] NULL, [CDEF_TYP_BUS] ...
Johnny Bones's user avatar
  • 8,502
0 votes
1 answer
195 views

First, to define what I'm talking about, the "length" of a source is how many characters it has. Having more characters allows improving readability by using more descriptive function and ...
Vladimirs Kacs's user avatar
2 votes
1 answer
203 views

How can I select a service mark (SM) symbol in SQL? select CHAR(0153) --> ™ select CHAR(0174) --> ® select CHAR(0169) --> © What would the equivalent be for a SM symbol?
Jesse O's user avatar
  • 67
2 votes
2 answers
118 views

Take this for example: DECLARE @xml XML = N' <members> <member> <name>John</name> <age>32</age> </member> <member> &...
Miles Fan's user avatar

15 30 50 per page
1
2 3 4 5
4911