Wednesday, December 12, 2018

SQL ERROR : Unable to Uninstall – Index was Outside the Bounds of the Array

SQL ERROR : Unable to Uninstall – Index was Outside the Bounds of the Array

YOU WILL GET THE ABOVE ERROR AT TIMES WHEN TRYING TO UNINSTALL SQL
RESOLUTION :

IN COMMAND PROMPT TYPE THE BELOW
C:\Program Files\Microsoft SQL Server\140\Setup Bootstrap\SQL2017
FOR THE ABOVE PATH

SETUP.EXE /ACTION=UNINTSALL.

NOW SELECT THE CONFIGURATION AND PROBLEM SOLVED.

THANKS


How to Shrink All Log Files for SQL Server? – Script to shrink all log files

HOW TO SHRINK ALL  LOG FILES FOR SQL SERVER? – SCRIPT TO SHRINK ALL LOG FILES

DECLARE @Script VARCHAR(MAX);
SET @Script = '';
SELECT
@Script = @Script +
'USE ['+ d.name +']; CHECKPOINT; DBCC SHRINKFILE ('+f.name+');'
FROM sys.master_files f
INNER JOIN sys.databases d ON d.database_id = f.database_id
WHERE f.type = 1 AND d.database_id > 4
-- AND d.name = 'SpecificDabasename'-- in case you want particular db log files to be shrinked
SELECT @Script Script
EXEC (@Script )

Execute it in masters database.
thanks,




SQL ERROR :Msg 15281 – SQL Server Blocked Access to STATEMENT ‘OpenRowset/OpenDatasource’ of Component Ad Hoc Distributed Queries

SQL ERROR :Msg 15281 – SQL Server Blocked Access to STATEMENT ‘OpenRowset/OpenDatasource’ of Component Ad Hoc Distributed Queries

Solution /Resolution :
you will have to wirte a t-sql query to allow access as below sample

EXEC sp_configure 'show advanced options', 1
RECONFIGURE WITH OVERRIDE
GO
EXEC sp_configure 'ad hoc distributed queries', 1
RECONFIGURE WITH OVERRIDE
GO


Thanks.