Hot answers tagged

8

Why are you not getting minimal logging? I have found the Data Loading Performance Guide, which you reference, to be an extremely valuable resource. However, it is also not 100% comprehensive, and I suspect that the grid is complex enough already that the author did not add a column Table Partitioning to break out differences in behavior depending on ...


4

Given that the script works without the header comment block but fails with it (but only for remote / TCP connections), the issue is most likely due to a parsing error. For example, SQLCMD and SSMS do their own pre-parsing of the submitted script (to break it into batches), and sometimes that pre-parsing doesn't work correctly (e.g. "GO" in 2nd half of ...


4

There are three parts to this Question, so let's start with the "Block on Data Loss" option, dropped Tables, and then dropped Columns. "Block on Potential Data Loss" Option If you enable the "Block incremental deployment if data loss might occur" option: on the "Debug" tab of "Project Properties" using the /p:BlockOnPossibleDataLoss=True command-line ...


2

sp_BlitzIndex from Brent Ozar will help you find and identify those: https://www.brentozar.com/blitzindex/sp_blitzindex-duplicate-indexes/ After that You will have to check those indexes on your own and decide which of them are obsolete. This isn't a task I would try automating with any kind of script.


2

Create a function like this in your DB: create function dm_db_index_physical_stats_tvf ( @db_id int ,@object_id int ,@index_id int ,@partition_number int ,@mode int ) returns @results TABLE ( [database_id] [smallint] NULL, [object_id] [int] NULL, [index_id] [int] NULL, [partition_number] [int] NULL, [index_type_desc] [nvarchar](60) NULL, [...


2

If you are in 80 compatibility mode, you need: DECLARE @dbid int = DB_ID(); SELECT t.name, i.name, ps.avg_fragmentation_in_percent FROM sys.tables AS t -- why A??? INNER JOIN sys.indexes AS i -- why B??? ON t.[object_id] = i.[object_id] CROSS APPLY sys.dm_db_index_physical_stats (@dbid,NULL,NULL,0,DEFAULT) AS ps -- why C??? WHERE ps....


2

The script provided by Microsoft in the Knowledge Base article: How to restore the missing Windows Installer cache files and resolve problems that occur during a SQL Server update ...found the missing files and allowed me to advance a bit: Save the script to your desktop Run it using CMD Cscript scriptname.vbs scriptoutput.txt Find all the copy ...


1

The sys.servers data dictionary view will give you the date that the Linked Server entry was modified/created (modify_date column), but not who created it.


1

for exact duplicates I have been using the script below: -- find duplicate indexes -- http://www.sqlservercentral.com/Forums/Topic1359723-392-1.aspx -- marcelo miorelli -- 31 jan 2013 set transaction isolation level read uncommitted ;WITH IndexColumns AS ( SELECT DISTINCT a.object_id, a.name, a.type_desc, b.column_id, ...



Only top voted, non community-wiki answers of a minimum length are eligible