Viewing 15 posts - 886 through 900 (of 7,614 total)
Actually, the development team should have nothing to do with how the data in the db is physically stored. That's the DBA's job. (Sorry, just had to say that first.)
I'll...
May 11, 2022 at 7:26 pm
If you don't need to worry about possible blank chars in the data, you can remove the trimming. I did it just as a safeguard.
;WITH test_data AS...
May 11, 2022 at 2:49 pm
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
Viewing 15 posts - 886 through 900 (of 7,614 total)