Viewing 15 posts - 241 through 255 (of 7,597 total)
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
Perhaps, but I would really expect SQL to generate effectively the same query plan for either code for something this straight forward.
February 1, 2024 at 3:57 pm
Your code is not really consistent, but here's my best guess:
UPDATE pt
SET LastModifiedDateTime = @dt
FROM dbo.PlayersTypes AS pt
INNER JOIN @TableTypePlayersRestrictions AS prt ON prt.PlayersRestrictionID = pt.PlayersRestrictionID
February 1, 2024 at 3:20 pm
I'd try to use differential backups, assuming you have a large amount of free disk space in qa, or could get it easily.
When you do a full backup in prod...
January 31, 2024 at 7:24 pm
SELECT
[freetext],
CASE WHEN FC_start = 0 THEN '' ELSE RTRIM(SUBSTRING([freetext], FC_start, FC_length)) END AS value
FROM dbo.testdata
CROSS APPLY (
...
January 30, 2024 at 5:21 pm
If you can provide actual sample data -- CREATE TABLE and INSERT statement(s) -- I can provide code to give you the results you want.
January 29, 2024 at 8:26 pm
Viewing 15 posts - 241 through 255 (of 7,597 total)