Viewing 15 posts - 541 through 555 (of 7,597 total)
I wouldn't just arbitrarily add a non-clus index without checking existing index usage ("index usage stats") AND reviewing missing indexes ("missing index" stats).
January 20, 2023 at 8:14 pm
Anyway, my question is to do with square brackets and including schema names. ... My inclination is to leave off as much stuff as possible (he also used to...
January 20, 2023 at 8:10 pm
How do you typically query the table? If you normally query by a range of datetime, then changing the clus index makes perfect sense.
First, change the SET @table_name_pattern = '%'...
January 20, 2023 at 3:57 pm
Something like this. The key is using aliases (AS ...) for the tables to make the code easier to write and to follow:
SELECT t0.column1, t1.Description, t2.Description, ...
FROM...
January 18, 2023 at 9:48 pm
Although SQL itself should issue CHECKPOINT commands when being shut down, I've found that explicitly issuing them myself prior to shutdown often allows SQL to restart faster. So, personally, yes,...
January 18, 2023 at 4:02 pm
First try getting rid of extraneous parts of the query (reducing the GROUP BY in the outer query):
SELECT [W_SE-MFG].dbo.YearMonthNo(J1.EntryDate) AS Per, SUM(J1.RunTime) AS TReg, MAX(J2.TNQ) AS TNQ
FROM...
January 17, 2023 at 8:32 pm
Maybe just scan the procedure text for "~TRUNCATE TABLE~" (where ~ is not A-Z0-9$_@). Then parse out the next word from the text to get the table name.
January 12, 2023 at 10:18 pm
Again, are you only looking at history for the current instance_id value?
January 12, 2023 at 8:37 pm
What do you mean "the job history says the job is running." The jobhistory never shows that, it only show the past history.
Be sure to verify the instance_id. ...
January 12, 2023 at 8:36 pm
What do you mean "the job history says the job is running." The jobhistory never shows that, it only show the past history.
Be sure to verify the instance_id. If it's...
January 12, 2023 at 7:53 pm
ISNULL/COALESCE is not as clear as explicitly checking for NULL:
SELECT COL1,
CASE WHEN Table1.COL2 = 0 then 'ZERO'
WHEN Table1.COL2 = 1 OR Table1.Col2 IS NULL then 'ONE'
ELSE ''...
January 10, 2023 at 6:48 pm
No, database and/or log backups would not cause this error.
January 9, 2023 at 5:38 pm
SELECT VendorName
FROM VenInfo
GROUP BY VendorName
HAVING SUM(CASE WHEN VenSN = 'Y' THEN 1 ELSE 0 END) * 100.0 / SUM(1) >= 80
January 9, 2023 at 3:25 pm
Nor trying to be difficult, but that just lists the values, it doesn't assign them as the table ID in the existing table, as stated in the OP.
January 6, 2023 at 10:40 pm
You could schedule a job to run on the first of the month, but immediately exit the job if that day is a Sunday. Add a second sched to that...
January 1, 2023 at 2:02 am
Viewing 15 posts - 541 through 555 (of 7,597 total)