Viewing 15 posts - 2,356 through 2,370 (of 13,879 total)
SELECT * FROM TABLE can't really be optimised, as far as I am aware. It's a full table scan.
(Even though you want all the columns, you should still name them,...
October 29, 2020 at 4:49 pm
I suggest that you do it using this method (copied from https://sqlperformance.com/2020/09/locking/upsert-anti-pattern):
BEGIN TRANSACTION;
UPDATE dbo.t WITH (UPDLOCK, SERIALIZABLE) SET val = @val WHERE = @key;
...
October 28, 2020 at 5:28 pm
In the application they would select, from a drop down one of the symbols (<,>,=,!=). I figured I can assigning them letters or numbers, if it is number one...
October 27, 2020 at 8:59 pm
You'll have to use fully dynamic SQL to make this work.
Building arithmetic expressions like this is generally regarded as an anti-pattern in the T-SQL world. What is the underlying business...
October 27, 2020 at 7:45 pm
@DesNorton, this sounds like a good solution, well done.
October 27, 2020 at 3:56 pm
Can you expand a little on what the 'sessions' are?
How should one 'session' know what the other sessions are doing (so that they don't have any overlapping or missed rows))?
How...
October 26, 2020 at 9:29 pm
In this case outer or cross is same thing - I do tend to use outer apply (left outer) instead of cross apply (inner join)
I have no idea whether this...
October 26, 2020 at 4:49 pm
Can you expand on what you mean by "but this doesn't produce the desired result"?
Note also that a unique constraint is not quite the same as a unique index.
October 26, 2020 at 3:07 pm
Frederico .... maybe you're onto something.
Your query has multiple references to ftbid01 which obviously should be to 01, 02, 03, ...
The outer apply could be a cross apply, or do...
October 26, 2020 at 2:27 pm
I don't see anything that would require this query to be written dynamically. This should work:
UPDATE a
SET fta1 = 'ftbid' + CAST(DAY(b.orderdate) AS VARCHAR(2))
FROM tba a
...
October 26, 2020 at 1:53 pm
The service account for which service, exactly? Or is the same service account running multiple services?
October 26, 2020 at 1:41 pm
I've done this before, using a Script Component source.
You'll find articles online from others who have done this before. Here is an example.
October 25, 2020 at 4:51 pm
They are views? But I specified o.type_desc = 'SQL_TABLE_VALUED_FUNCTION' in Where clause.
Sorry, I thought you were referring to sys.objects and sys.key_constraints.
TVFs obviously don't have PKs. Not sure why it...
October 23, 2020 at 5:49 pm
They're Views, not TVFs. Views don't have PKs.
October 23, 2020 at 5:13 pm
Viewing 15 posts - 2,356 through 2,370 (of 13,879 total)