Viewing 15 posts - 646 through 660 (of 2,645 total)
SELECT '2500------' AS Field1,
'------' AS Field2,
'------' AS Field3,
...
December 4, 2022 at 12:36 am
SELECT d.*, p.CurrentSizeGB - d.CurrentSizeGB size_diff
FROM [dev_db_size] d
INNER JOIN [prod_db_size] p
ON RIGHT(p.FileName, 3) =...
November 21, 2022 at 11:43 am
Jeffrey Williams wrote:It might be a better option - if using TRY/CATCH - to THROW the error instead of using RAISERROR.
I'd be interested to hear your reasoning.
Using THROW will save...
November 17, 2022 at 5:17 pm
While I'm not an AWS expert by any means when you deploy an RDS instance of SQL it looks to in the backend just put the MDF/NDF/LDF/BAK/TRN all on...
November 14, 2022 at 2:35 pm
The purpose of a data warehouse is to be able to query the data quickly. If you only insert values that have changed with start and end dates, the table...
November 13, 2022 at 10:31 pm
with cte as (select 'PartNbr|#@|Machine|#@|CCode|#@|Cost|#@| ttxx23|#@|plc1|#@| ttxx24|#@|plc2' Value)
,cte2 as (select x.value, x.position from cte
cross...
November 12, 2022 at 1:05 pm
Thanks for spotting that Jeff. I deliberately wrapped an LTRIM around the return value so if a manually written csv sometimes had comma space or just comma it would return...
November 12, 2022 at 1:57 am
If you use this nvarchar(MAX) STRING_SPLIT function
You can do it with the following code:
with cte as (select 'PartNbr|#@|Machine|#@| ttxx23|#@|plc1|#@| ttxx24|#@|plc2' Value)
,cte2 as (select x.value,...
November 11, 2022 at 9:29 pm
I need to add a single quote in each of the alternate characters. The input string could be a variable length.
As an example:
Input String: 5,1,6,1,69,1
output: '5',1,'6',1,'69',1
Input String: 5,1,6,1,3,2,5,3,69,1
output:...
November 2, 2022 at 10:57 pm
Ah, I see, test driven development:
;with cte as
(
select * from (values ('Restaurant'),
...
October 31, 2022 at 9:09 pm
Considering there's something urgent going on, why not tell us exactly what it is that you're trying to do and then we might be able to better help. All...
October 24, 2022 at 1:39 pm
IF OBJECT_ID('tempdb..#temp','u') is not null
DROP TABLE #temp
GO
SELECT *
INTO #temp
FROM (VALUES ('MN', 'KL'),
...
October 20, 2022 at 3:46 pm
This code would check for State = 'MN' AND ProdCodes NOT IN ('Kl', 'Kjh') )
I need it to exclude ProdCodes NOT IN ('Kl', 'Kjh') When the state is MN.
That's...
October 20, 2022 at 3:38 pm
That may work but I need something a little different:
I need the if it is State = MN then Exclude ProdCodes IN ('Kl', 'Kjh') Else if State not =...
October 20, 2022 at 3:14 pm
Thanks for the reply, but that is not what I need.
I need a way to write this that when the state is MN then these ProcCodes are Excluded, but...
October 20, 2022 at 2:49 pm
Viewing 15 posts - 646 through 660 (of 2,645 total)