Viewing 15 posts - 241 through 255 (of 1,464 total)
The display that you are seeing is the format of the time data type. You should not be formatting the data in SQL - That is the job of the...
November 20, 2021 at 8:59 am
You have not provided the format that you need the time difference in, so I am providing it as [time].
However, this will not cater for values greater than 24 hours.
November 20, 2021 at 7:01 am
Below are 2 alternative ways to write the same query, but without the LEFT JOIN. They may have an improvement in performance, so test, test, test.
SELECT ...
November 19, 2021 at 2:45 pm
This will work with the sample data that you provided
WITH cteData AS (
SELECT t.Id
, t.CarID
, t.CarStatus
...
November 5, 2021 at 7:54 am
Option2 is going to give you terrible performance because the @Name = '', @zip = '' and @colors = '' in the WHERE clause will force a table scan every...
November 2, 2021 at 6:08 am
With no readily available test data, I would try to edit the 1st CTE as follows
;with ClockIn as
(select [Initial],[RFID],[Time] as ClockInTime from Data where Type=1 and [Time]...
September 6, 2021 at 9:29 am
Thank you DesNorton,
I got that, my question was how can I incorporate that in this single statement, that null values update always need to check for all columns, if...
June 25, 2021 at 10:59 am
You could use ISNULL for your update, so that it does not replace existing values with NULL.
Something like this ....
UPDATE dest
SET dest.Value = ISNULL(src.Value, Dest.Value)
FROM SourceTable AS...
June 25, 2021 at 6:51 am
Brief tangent into real SQL stuff...
Has anyone ever heard of table triggers not firing for every row if you do set-based updates to records?
Our vendor sent us code for...
June 14, 2021 at 1:12 pm
I would change the data types in the #SourceTable. Or at least create another intermediate process that cleans/types the data. Otherwise, you are asking for a world of hurt
May 26, 2021 at 6:36 am
Please read this article on upserts and concurrency http://source.entelect.co.za/why-is-this-upsert-code-broken
From the above, you should end up with code that looks like this
UPDATE ...
May 26, 2021 at 6:04 am
For the above to work, TableName1 and TableName2 would need to have have the same structure.
Since the structure is the same, why not use
SELECT * FROM TableName1
EXCEPT
SELECT...
April 18, 2021 at 3:47 pm
You are hammering the same tables multiple times. You will probably get better perf if you use cross-tab queries to reduce the number of times the tables are read. I...
April 9, 2021 at 6:07 pm
I believe that your join should be
FROM Schedule INNER JOIN
Operations ON Schedule.WorkCenterID = Operations.Operation
April 9, 2021 at 7:26 am
// some operation insert update of my temps table @TempMrc, @TempReport
If you are only doing DML operations on the @Tables, then you should not be using a transaction, as the...
March 26, 2021 at 3:12 pm
Viewing 15 posts - 241 through 255 (of 1,464 total)