Viewing 15 posts - 5,161 through 5,175 (of 7,597 total)
If the code ran in just 8 minutes, and you like it and results, it's logical for you to leave it as is.
April 21, 2015 at 9:51 am
I agree. You'd expect the specifically-chosen (?) "featured script" to be something at least moderately good/useful, but most often they are not.
As for this code, I would suggest simply:
SELECT...
April 21, 2015 at 8:27 am
Alan.B (4/17/2015)
What's wrong with this?
SELECT
DbName = db.name,
FileType =...
April 20, 2015 at 3:19 pm
There could also be some type of locking, and thus blocking, on the underlying system tables. I've seen this happen when, for example, people do a "SELECT ... INTO...
April 20, 2015 at 3:14 pm
Since you're trying to do a keyed lookup on the CL table, the conversion should be other way around to allow SQL to do a seek on all three key...
April 20, 2015 at 3:11 pm
I see a couple of other issues, besides formatting, with your code.
1) Step 0 is a summary for the entire job, including duration. So if you add step 0...
April 20, 2015 at 2:57 pm
there is a pre-set default fillfactor, but I've seen it set as low as 70%, it's not automatically 100%.
RonKyle (4/20/2015) What does this mean? The default is 0 (100%)....
April 20, 2015 at 1:08 pm
RonKyle (4/20/2015)
...Be careful of fillfactor, else it is possible that your table ends up taking up more space, unless that is what is expected.
If your choice of a clustered index...
April 20, 2015 at 9:39 am
Doesn't have to be an iTVF, you can still use dynamic SQL, just process all columns in a given table in one statement, not multiple.
April 20, 2015 at 7:34 am
dwain.c (4/19/2015)
ScottPletcher (4/17/2015)
April 20, 2015 at 7:31 am
Cursoring through the tables is fine, but you should process all columns in a single table in one pass (scan), not a separate pass for each column.
April 17, 2015 at 9:36 am
I don't understand how this code can work.
Your subqueries to tt1 / t2 don't contain any column named "Id_1" yet you reference that column when you join to t2: I...
April 17, 2015 at 9:33 am
First, I don't see that code as turning on any setting. It sets a local variable value, that's it. You happened to name that local variable "[@]IMPLICIT_TRANSACTIONS", but...
April 17, 2015 at 7:24 am
The on-going maintenance is higher for an INSTEAD OF trigger, since every column addition or deletion, and some column changes, all requires changes the trigger, which is not the case...
April 17, 2015 at 6:48 am
CREATE TRIGGER MYTABLE_AUDIT__TRG_INSERT_UPDATE
ON dbo.MYTABLE_AUDIT
AFTER INSERT, UPDATE
AS
SET NOCOUNT ON;
UPDATE ma
SET ma.DateModified = GETDATE()
FROM MYTABLE_AUDIT ma
INNER JOIN inserted i ON
i.AID = ma.AID
WHERE
i.DateModified IS NULL;
GO...
April 16, 2015 at 2:36 pm
Viewing 15 posts - 5,161 through 5,175 (of 7,597 total)