Viewing 15 posts - 1,696 through 1,710 (of 2,645 total)
You just need to add the table in a CROSS APPLY or OUTER APPLY and select TOP(1) with an ORDER BY date DESC...
From Beaufort.dbo.DPIB010 t1
CROSS...
February 22, 2019 at 9:17 am
frederico is right, you should change the table definition to store date type values. But you can order that string in date orderSELECT TOP(1) *
FROM...
February 21, 2019 at 3:38 pm
SQL Server will use all the memory you allow it to if it can, it buffers data in memory.
You should limit the amount of memory SQL Server can...
February 21, 2019 at 3:33 pm
I had to do something similar. I ended up having job2 (that's dependant on job1) scheduled to run at frequent intervals, the first step would test the latest row on...
February 21, 2019 at 11:07 am
Are you sure it's the sort that's taking the time? Have you tried it without the sort and if so is it much faster?
February 21, 2019 at 10:44 am
SELECT t.RecordId,
t.dateId FromDate,
x.dateID ToDate,
t.Quantity
FROM @T t
CROSS APPLY(SELECT TOP(1)...
February 21, 2019 at 10:13 am
February 21, 2019 at 9:45 am
It might be my lack of understanding about the MERGE statement, I've always found performance better by replacing a MERGE with UPDATES followed by INSERTS. But at the top of...
February 21, 2019 at 6:40 am
February 21, 2019 at 5:58 am
case when @valiValue is null then 'N/A' else
CASE WHEN CHARINDEX(''''+RTRIM(@VALUE)+'''', @valiValue) > 0 THEN
'PASS' else 'FAIL' END END as Validation_Result,
February 20, 2019 at 5:00 am
Just create the table, populate it with as many realistic rows as you can then run the report.
To run the report you just right click on the database in...
February 19, 2019 at 11:47 am
I have a requirement where I need to see how much space is used...
February 19, 2019 at 11:24 am
Here's a way to do it using only mathematical operations, I think it will be less efficient than using a replace though.
DECLARE @table TABLE (ID INT...
February 19, 2019 at 10:24 am
February 18, 2019 at 1:30 pm
Viewing 15 posts - 1,696 through 1,710 (of 2,645 total)