Viewing 15 posts - 16 through 30 (of 49 total)
You can write a case statement in your order by clause like below - however this will not be an ideal solution because of hardcoded values . I guess better...
July 31, 2019 at 12:31 pm
Instead of using row_number try using lead or lag
Thanks
July 19, 2019 at 8:16 am
I had similar issue going from 2008R2 to 2016 - after much trial and error found that Solution's Configuration Properties - DeployementTargertVersion was set to SQL Server 2017 - changing...
July 12, 2019 at 8:14 am
Came up with this but I am curious to know if there is a more elegant way to achieve it
SELECT Id ,
...
July 9, 2019 at 3:39 pm
Don't have an answer to this - but learned something new today. I would have expected it to fail as well but tested it out and it works !
July 5, 2019 at 8:56 am
Hi
The package will not be in SSISDB - it will be in Integration Services Catalog - which will be below all the database as a separate twistie
June 10, 2019 at 8:23 am
At first glance and without actually looking at the data looks like this is the problem - CAST(AR_USERENTRY AS NUMERIC(18, 2)) >= 0 You can give TRY_CAST a try - as...
May 31, 2019 at 12:42 pm
You can try self join - the one I have written brings two overlapping ids
SELECT *
FROM #ChargeDataTemp AS cdt
INNER JOIN #ChargeDataTemp AS cdt2
ON cdt2.AssetReference...
May 31, 2019 at 9:45 am
I would add another condition to it
declare @a varchar(100) = 'GUDR200305R02'
--IF PATINDEX('[^0-9][^0-9][^0-9][^0-9][120000-999999][R][0-9][0-9]',@a)>0
IF PATINDEX('[^0-9][^0-9][^0-9][^0-9][0-9][0-9][0-9][0-9][0-9][0-9][R][0-9][0-9]',@a)>0 AND CAST(SUBSTRING(@a,5,2) AS INT) >= 12
Print 'T'
Else
Print 'F'
Thanks
May 31, 2019 at 9:14 am
I would have written the code differently - basically find the first day of next month and then subtract the number of days from there
However I have a feeling there...
May 30, 2019 at 2:48 pm
In order to get the most recent record of each patient from Patdata you can use something like below
;WITH cte_p AS
(
SELECT p.id , surname , bed...
May 29, 2019 at 1:09 pm
If the question was just to convert union into join - I would have gone with full join with coalesce function -though this will not work in the view either
May 28, 2019 at 3:11 pm
Well you can do this - makes it short not sure if actually better
SELECT c.* , CCL.column_names
FROM [RawDownloads].[dbo].tbl_K8_Customer C
LEFT JOIN [RawDownloads].[dbo].tbl_k8_Customer CCL
ON...
May 17, 2019 at 2:30 pm
I guess you can load the data in some sort of staging table first - clean it up there and then load it in the destination table
Thanks
April 16, 2019 at 9:02 am
Does this work for you
;WITH cte_test
AS ( SELECT *
, ROW_NUMBER() OVER (PARTITION BY clientid ORDER BY ClientImportsId desc...
April 10, 2019 at 3:34 pm
Viewing 15 posts - 16 through 30 (of 49 total)