Viewing 15 posts - 241 through 255 (of 7,602 total)
The first three rows in the table DO all match the first "<" condition: 00:05:xx and 00:10:xx are less than 00:15:xx. Only the second condition limits the result to a...
February 13, 2024 at 7:53 pm
For example, when the lengths are consistent, it seems to produce the desired result:
DROP TABLE IF EXISTS #xr;
CREATE TABLE #xr ( length_min varchar(8) NOT NULL, length_max varchar(8)...
February 13, 2024 at 7:49 pm
It seems like this is a character comparison. If so, "00:15:18" would not compare correct "0:...", since you have two leading zeros vs one leading zero. If you're going to...
February 13, 2024 at 7:45 pm
Don't change the CASTing for the bits in the WHERE clause, leave as is. Otherwise I believe SQL will default to a different data type which would force a column...
February 13, 2024 at 7:37 pm
I generated SQL separately for each view, even though that requires a cursor. In this specific case, I think you may want to be able to control things table by...
February 12, 2024 at 3:13 pm
Somehow you left out the "SET @MyBit = 0" on one function?
February 9, 2024 at 9:17 pm
Except stay completely away from INFORMATION_SCHEMA views, which are more overhead anyway. Use sys.tables, sys.columns, etc., instead.
February 9, 2024 at 7:55 pm
And what would you want to name the view?
February 9, 2024 at 6:23 pm
Sample data and results are almost always clearer than just a textual explanation. I hope this matches what you need:
SELECT
ISNULL(t2.CarColor, t1.CarColor) AS CarColor,
...
February 8, 2024 at 7:31 pm
IF I understand the q correctly, then:
SELECT
ISNULL(t2.CarColor, t1.CarColor) AS CarColor,
t1.CarName,
t1.CarStatus
FROM Db1.CarTbl1 t1
LEFT OUTER JOIN Db2.CarTbl27...
February 8, 2024 at 6:37 pm
SQL wouldn't necessarily have to scan the entire table, if the relevant columns happened to be in a nonclus index -- not likely here, but theoretically possible.
February 5, 2024 at 6:33 pm
Sorry, I couldn't tell you that, I'm not a SAN/hardware person, just a DBA.
February 3, 2024 at 9:36 pm
(1) Yes, to me, highly impractical.
(2) No real need to make the db read only:
(A) take diff backup (if you feel safer that way);
(B) Switch to SIMPLE recovery;
(C) Issue a...
February 3, 2024 at 8:22 pm
I would do this the other way around. That is, rather then deleting 15 years' worth of data, copy the current 2 year's worth of data to another db. Then,...
February 2, 2024 at 6:38 pm
But if we have LEFTor RIGHT JOIN as below,is it possible to improve something at this case?
SELECT pr.column1, pr.column2 FROM PlayersTypesAS pr WITH(NOLOCK) INNER JOIN dbo.Players AS p WITH(NOLOCK)...
February 1, 2024 at 6:27 pm
Viewing 15 posts - 241 through 255 (of 7,602 total)