Viewing 15 posts - 4,141 through 4,155 (of 7,597 total)
Back to the original post, that code looks far better than most of what I see as a DBA!
Just one serious change, to get rid of the CAST of/function against...
September 14, 2016 at 3:25 pm
Keep in mind, though, that you could use non-temp table names in tempdb. Tables will have slightly less overhead in tempdb.
September 14, 2016 at 10:57 am
It sounds like you have typical "createdate", "createuser", 'updatedate", "updateuser" that you want to exclude.
But do it by column name rather than position. Those won't necessarily be the last...
September 14, 2016 at 9:13 am
trigger should get columns from sys.columns and I need to create similar triggers for many tables
No, it should not! That's far, far too much overhead.
The trigger should not...
September 12, 2016 at 3:45 pm
tshad (9/12/2016)
That could be an issue if you have rows that large. I have a customer where some of out tables column definitions exceed the row size by hundreds...
September 12, 2016 at 3:39 pm
tshad (9/10/2016)
September 12, 2016 at 1:04 pm
Also maybe check:
SQL Jobs (who knows, maybe a yearly job)
SSIS data sources / SSIS packages
September 6, 2016 at 1:36 pm
The other really huge performance factor to consider is how the tables are joined. Often natural keys allow for merge joins, which are extremely efficient even on very large...
September 6, 2016 at 12:37 pm
You can add all 5 columns to a given table in one statement, but you need separate statements for each table.
September 6, 2016 at 10:44 am
I reject entirely the notion that there is such a thing as a "default" clustering key. That is the issue to me. While certainly there are times when...
September 6, 2016 at 10:40 am
If the overall number of pages to be read is small either way, it's just not worth the optimizer's time to keep going.
SQL naturally favors the clustered index. Overall...
September 2, 2016 at 9:55 am
Sean Lange (9/2/2016)
ScottPletcher (9/2/2016)
September 2, 2016 at 9:53 am
Don't have time right now to fully test/refine this, but it should be close at least:
SELECT DISTINCT
SERVERPROPERTY('servername') [instance]
,DB_NAME() [database]
,QUOTENAME(OBJECT_SCHEMA_NAME(p.object_id)) +'.'+QUOTENAME(Object_name(p.object_id))
,p.data_compression
,p.data_compression_desc
FROM sys.partitions p
INNER JOIN (
SELECT container_id, SUM(total_pages)...
September 2, 2016 at 8:28 am
A clustering index is enough to avoid having a heap, you don't have to have a primary key. In particular, don't slap an identity column on the table just...
September 2, 2016 at 8:00 am
Luis Cazares (9/1/2016)
drew.allen (9/1/2016)
First, the mantra is "It's a bad idea to declare a cursor. Period. End of sentence." 😀Drew
Second, cursors can be local or global and the default is...
September 1, 2016 at 1:44 pm
Viewing 15 posts - 4,141 through 4,155 (of 7,597 total)