Viewing 15 posts - 3,271 through 3,285 (of 7,614 total)
A tightly-written standard scalar function is another option. I'll give you mine. But you'll have to add the UK post code part to it, since this code was not written...
July 12, 2018 at 10:11 am
Did you verify that all the constraints are "trusted"? If not trusted, perhaps that could cause an issue.
July 11, 2018 at 11:13 am
A cross tab will do it nicely.
SELECT
MAX(CASE WHEN rowOrder = 1 THEN xImage END) AS xImage1,
MAX(CASE WHEN rowOrder...
July 10, 2018 at 2:55 pm
If the app/person/whatever doing the UPDATE is not a sysadmin, (or perhaps a dbo, not sure on that one), maybe you can just DENY UPDATE on that column:
July 10, 2018 at 11:43 am
Another option is to create a proc in master named sp_<whatever> (the name must start with sp_), mark it as a system proc, then you can execute from any db...
July 10, 2018 at 11:33 am
July 10, 2018 at 11:04 am
SELECT *,
CASE WHEN start_of_value = 1 THEN ''
ELSE SUBSTRING(CI_NUM, start_of_value, 5) END AS [5charsyouwant]
FROM ( VALUES('asdfasf-ABCDE-asdfasdfsfasf'),('ss-TREWQ-asdfasfsf'),
('asdfa-12-ABCDE-kindatricky'),('nothingtoseehere'),
...
July 10, 2018 at 10:49 am
So I guess it's doing a non-clustered index seek? When you go that route, you have to be careful of the "tipping point", where SQL falls back to scanning the...
July 10, 2018 at 10:44 am
100% agree with Phil. Get everything in one read and save/cache it for your app however you need to. Db read round trips (from your app to the db server...
July 10, 2018 at 8:14 am
July 9, 2018 at 3:45 pm
July 9, 2018 at 10:35 am
Btw, I'd stronbly encourage you to use:
and SQLDateTime < '2018-07-03T08:00:00 AM'
rather than:
and SQLDateTime <= '2018-07-03T07:59:00 AM'
July 9, 2018 at 10:24 am
As both of us have stated, run a CHECKDB to get an idea of the scope of the problem. One error or 100 errors?
I forgot to mention before...
July 6, 2018 at 12:38 pm
Viewing 15 posts - 3,271 through 3,285 (of 7,614 total)