SQL SERVER – Installation Failure Database engine services failed.

Sometimes when we install SQL Server or Add any new SQL Server Instance on Windows Machine, we can see the database errors listed below.
To resolve these errors we are trying to repair existing installation or do something else.
If nothing happens then we are trying to install it completely from control panel, but it is not 100% sure that the fresh new installation will works. Some of the SQL Server links existing at system registry so we are not able to get it success.

Installation error list
Installation error
Installation error list
Installation error list

To resolve these registry things we can un-install all SQL server related things by theirs ID.

The ID we can get using “WMIC” command. So run this command on console:

WMIC PRODUCT Where "Caption like '%SQL%'" GET Caption, IdentifyingNumber
WMIC Result
WMIC Result

You will get a list of objects with their identifier.

Now un-install these all things one by one using below command:

msiexec /x {GUID}

i.e..

msiexec /x {ABB6AC00-F1D8-4EBF-8128-830D090B76C0}

 

I think after that restart the machine and try fresh installation, will works.

Import CSV using “Microsoft Access Database Engine 2010” to SQL Server


sp_configure 'Ad Hoc Distributed Queries', 1
reconfigure with override

SET NOCOUNT ON

EXEC master..xp_cmdshell 'del C:\Temp\Schema.ini'
EXEC master..xp_cmdshell 'echo [Test.txt] > C:\Temp\Schema.ini'
EXEC master..xp_cmdshell 'echo ColNameHeader=True >> C:\Temp\Schema.ini'
EXEC master..xp_cmdshell 'echo Format=Delimited(^|) >> C:\Temp\Schema.ini'
EXEC master..xp_cmdshell 'echo MaxScanRows=50 >> C:\Temp\Schema.ini'
EXEC master..xp_cmdshell 'echo CharacterSet=OEM >> C:\Temp\Schema.ini'

EXEC master..xp_cmdshell 'echo Col1=ID TEXT >> C:\Temp\Schema.ini'
EXEC master..xp_cmdshell 'echo Col2=LastName TEXT >> C:\Temp\Schema.ini'
EXEC master..xp_cmdshell 'echo Col3=FirstName TEXT >> C:\Temp\Schema.ini'
EXEC master..xp_cmdshell 'echo Col4=MiddleName TEXT >> C:\Temp\Schema.ini'
EXEC master..xp_cmdshell 'echo Col5=MailingAddressLine1 TEXT >> C:\Temp\Schema.ini'
EXEC master..xp_cmdshell 'echo Col6=MailingAddressline2 TEXT >> C:\Temp\Schema.ini'
EXEC master..xp_cmdshell 'echo Col7=MailingAddressCity TEXT >> C:\Temp\Schema.ini'
EXEC master..xp_cmdshell 'echo Col8=MailingAddressState TEXT >> C:\Temp\Schema.ini'
EXEC master..xp_cmdshell 'echo Col9=MailingAddressZIP TEXT >> C:\Temp\Schema.ini'

EXEC ('INSERT INTO ImportTest (ID,LastName, FirstName,MiddleName, MailingAddressLine1,MailingAddressline2,MailingAddressCity, MailingAddressState,MailingAddressZIP)
SELECT ID,LastName, FirstName,MiddleName, MailingAddressLine1,MailingAddressline2,MailingAddressCity, MailingAddressState,MailingAddressZIP
FROM OPENROWSET(''Microsoft.ACE.OLEDB.12.0'',''Text;Database=C:\Temp\;HDR=YES'',''select * from person.txt'')
')
EXEC master..xp_cmdshell 'del C:\Temp\Schema.ini'