Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I am trying to restore database created on server to my localbox however i am getting 'Error: Specified cast is not valid. (SqlManagerUI)' error message.

Server Info: Windows Server 2008 Standard 64 bit Microsoft SQL Server 2008: (Info obtained from SSMS About page)

    Microsoft SQL Server Management Studio      10.0.4064.0 
Microsoft Analysis Services Client Tools        10.0.4064.0
Microsoft Data Access Components (MDAC)         6.0.6002.18005
Microsoft MSXML                                 3.0 6.0 
Microsoft Internet Explorer                     8.0.6001.19190
Microsoft .NET Framework                        2.0.50727.4216
Operating System                                6.0.6002

My Localbox: Windows 7 64bit Microsoft SQL Server 2008:

Microsoft SQL Server Management Studio          10.0.4064.0
Microsoft Analysis Services Client Tools        10.0.4064.0
Microsoft Data Access Components (MDAC)         6.1.7601.17514
Microsoft MSXML                                 3.0 4.0 5.0 6.0 
Microsoft Internet Explorer                     9.0.8112.16421
Microsoft .NET Framework                        2.0.50727.5448
Operating System                                6.1.7601

Does anyone know how to fix this issue?

Sanjeev

share|improve this question

migrated from stackoverflow.com Mar 7 '12 at 16:15

This question came from our site for professional and enthusiast programmers.

    
What about SELECT @@VERSION on each: this is more important –  gbn Mar 7 '12 at 14:14
    
where iam suppose to look for that info? –  sanjeev40084 Mar 7 '12 at 14:20
    
You run it as a query against SQL Server... –  gbn Mar 7 '12 at 14:25

2 Answers 2

Generate the restore script from the GUI, instead of using the GUI to do the restore.

Then add the PASSWORD option...

--generated from the GUI dialog box
RESTORE DATABASE foo FROM  DISK = N'somepath' WITH ...

-- and add this
PASSWORD = '**password_is_this**'
GO
share|improve this answer
    
got this error message: Msg 3102, Level 16, State 1, Line 1 RESTORE cannot process database '<databaseName>' because it is in use by this session. It is recommended that the master database be used when performing this operation. Msg 3013, Level 16, State 1, Line 1 RESTORE DATABASE is terminating abnormally. script: RESTORE DATABASE <databaseName> from DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\Backup\backup.bak' –  sanjeev40084 Mar 7 '12 at 14:27
3  
Did you read the error? ..because it is in use by this session... You are blocking yourself... –  gbn Mar 7 '12 at 14:29
    
yes, i did and no matter how many times i close the ssms and open and run the script, i still run into that error. –  sanjeev40084 Mar 7 '12 at 15:18
up vote 0 down vote accepted

This was the issue: http://technoscatter.blogspot.com/2011/11/ms-sql-troubleshoot-2-specified-cast-is.html

share|improve this answer
    
Instead of linking to the answer, you should add details about the problem and how you resolved it. –  Max Vernon Nov 1 '13 at 2:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.