Viewing 15 posts - 2,326 through 2,340 (of 13,870 total)
You could create a calculated, persisted column in your table definition and SELECT that instead.
November 3, 2020 at 8:57 pm
that worked.thanks
And mine didn't? For the sample data you provided, I think it did; it's fast too.
If, as Scott no doubt correctly surmised, your actual data contains variations on...
November 3, 2020 at 7:48 pm
Really? >8,000 points and you still cross-post!
Answers here, please.
November 3, 2020 at 4:16 pm
DROP TABLE IF EXISTS #Path;
CREATE TABLE #Path
(
FilePath VARCHAR(200) NOT NULL
);
INSERT #Path
(
FilePath
)
VALUES
('A:\AABCD\EDFG\RFG\MyDB123.bak')
,('A:\RFG\MyDB1123.bak')
,('A:\AABCD\EDFG\MyDB1223.bak');
SELECT p.FilePath
,LEFT(p.FilePath, CHARINDEX('MyDB',...
November 3, 2020 at 4:13 pm
November 2, 2020 at 3:58 pm
OK, now I understand why you wrote that.
Despite mention of the CS by the OP, my assumption was that this was a data flow containing multiple columns, one of which...
November 2, 2020 at 2:37 pm
Are there lots of different tables being changed? If so, the answer is likely to be one of
If only a handful of table are being modified,...
November 2, 2020 at 2:10 pm
I assume all you need it this:
LEN((DT_WSTR, 4) [Your Column]) == 4
If the values can also be longer than 4 characters as well increase the...
November 2, 2020 at 2:07 pm
I understand, but most SQL devs (including me) try to avoid triggers, as they can become difficult to manage, and sometimes have unexpected side effects.
The above is such a complicated...
October 30, 2020 at 6:38 pm
This sounds like business logic which should be handled in the stored proc which your front-end application calls when performing the INSERT.
October 30, 2020 at 6:17 pm
You get the original reply in the email. If the OP changes it, you don't see the change in another email.
Which is quite handy on those occasions where the...
October 29, 2020 at 9:38 pm
I am looking to see if there are any ways to improve the run time for select queries.
This was the request I responded to. The remainder of your post provides...
October 29, 2020 at 7:27 pm
Take a look in the Books section here too.
October 29, 2020 at 4:52 pm
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
Viewing 15 posts - 2,326 through 2,340 (of 13,870 total)