Search

Loading...

Friday, December 2, 2016

The media family on device '' is incorrectly formed. SQL Server cannot process this media family. RESTORE FILELIST is terminating abnormally.

Error:

The media family on device ‘<FILENAME.BAK>’ is incorrectly formed. SQL Server cannot process this media family. RESTORE FILELIST is terminating abnormally.

Solution:

Ensure that backup file is good and copied properly.
You can not restore higher version databse Backup in lower version SQL Server.

Friday, October 21, 2016

Error occurred during installation: Error 1618 installing Microsoft SQL Server setup Support files.

You may get below error during SQL server installation:

Error occurred during installation: Error 1618 installing Microsoft SQL Server setup Support files.

Follow below steps to solve the error:

  1. Restart The system and try installing.
  2. Start - Run - Type: gpedit.msc - OK - Navigate to

Computer Configuration\Windows Settings\Security Settings\Local Policies\User Rights Assignment\Debug programs
Add administrator user.

Monday, May 30, 2016

Login failed for user ‘domain\username’. Reason: Server is in single user mode. Only one administrator can connect at this time.

You may get below error some time after improper shutdown of system.

Login failed for user ‘domain\username’. Reason: Server is in single user mode. Only one administrator can connect at this time.

Restart SQL server and Browser and problem will be solved.

Thursday, February 18, 2016

Query to get IP address of SQL Server

Use below query to get IP address of SQL Server:

DECLARE @IP varchar(40)
DECLARE @IPLine varchar(200)
DECLARE @Pos int

SET NoCount ON
SET @IP = NULL

Create Table #Temp (IPLine VarChar(200))
INSERT #temp EXEC master..xp_cmdshell 'IPconfig'

SELECT TOP 1 @IPLine = IPLine FROM #Temp
WHERE Upper (IPLine) LIKE '%IP ADDRESS%' OR Upper (IPLine) LIKE '%IPV4 ADDRESS%' 
    IF (ISNULL (@IPLine,'***') != '***')
      BEGIN 
       SET @Pos = CharIndex (':',@IPLine,1);
       SET @IP = LTrim(RTrim(SubString (@IPLine , @Pos + 1 ,len (@IPLine) - @Pos)))
      END 
PRINT @IP
DROP TABLE #temp
SET NoCount OFF

If you get below error after executing above query:

Msg 15281, Level 16, State 1, Procedure xp_cmdshell, Line 1
SQL Server blocked access to procedure 'sys.xp_cmdshell' of component 'xp_cmdshell' because this component is turned off as part of the security configuration for this server. A system administrator can enable the use of 'xp_cmdshell' by using sp_configure. For more information about enabling 'xp_cmdshell', see "Surface Area Configuration" in SQL Server Books Online.

Than you had to enable xp_cmdshell in surface area configuration. and than rerun the above query.

Monday, February 8, 2016

How to show backup or restore progress to user in a progressbar?

You can show backup or restore progress to user in a progress bar if you had installed 

sp_who2k5 

into your master database. You have to run the below command:

sp_who2k5 1, 1

The result will include all active transaction. Search the backup in the requestCommand field. The aptly named percentComplete field will give you the progress of the backup.