restore database from .file format - sql-server-2012

Currently, I am using Microsoft SQL Server 2012, My client gives me only file format database file.When I select this file for restore, Error occurs
"No backupset selected to be restored"
I was already trying to change file extension change to dot[.] bak format but it also not work.
So how can I restore database file from file format(not .bak format) to Microsoft SQL Server 2012?

Related

pg_restore: [directory archiver] could not open input file. Error while trying to restore DB

Error when trying to restore a backup file(.nb3).
I did a database backups in Navicat, one backup for each schema. They are .nb3 files.
I tried to restore my DB on a local server using pgAdmin. I got an error like this after choosing backup file :
How do I restore the database on a local server?
NB3 NaviCat backup files can be restored using the NaviCat software.
Add the database connection in NaviCat
Double click on the connection and go to Backup
Right-click on the empty backup window and select "Restore from..." from the menu
Select your nb3 file

Restore BacPac database backup in sql server 2014

I have database backup file with extension .bacpac so how can i restore it in sql server 2014 ?
Two options:
In SQL Server Management Studio, right-click on the Databases folder in the Object Explorer tree. Then click on "Import Data-tier application". The wizard will guide you through the process.
From the command line, run this command: "c:\program files (x86)\Microsoft sql server\120\dac\bin\sqlpackage.exe" /a:import /sf:"PATH_TO_YOUR_BACPAC_FILE" /tcs:"Data Source=YOUR_SERVER_NAME;Initial Catalog=NEW_DATABASE_NAME;Integrated Security=true"
Aside: Note that the example connection string in the command line option above assumes you're using Windows Authentication instead of SQL Server authentication to access the server.

SQL Server 2012 locate backup file not displaying file structure

I have recently installed SQL Server 2012 Express. When I try and restore a previous database, the "Locate Backup File" box is not displaying correctly:
When I maximise the window, it looks like this:
Which means that I can't select a backup. But has anyone else had this issue and how was it resolved?
I'm not sure how to fix the UI problem, but if you want to restore your database, run this code.
RESTORE DATABASE yourDatabaseName
FROM DISK = 'C:\Program Files\Microsoft SQL Server\MSSQL13.SQLEXPRESS\MSSQL\Backup\yourDatabaseName.bak';

Database wont attach to Microsoft SQL Server Management Studio

I'm trying to attach a database to Microsoft SQL Server Management Studio. I have moved the .MDF file into C:\programfiles\Microsoft SQL Server\MSSQL11.MSSQLEXPRESS\MSSQL\Data
It shows up when I go to the attach screen but I get this error message when I hit 'OK' on the attach screen:
Attach database failed for Server 'DESKTOP-5DHLE7T\sqlexpress'.
(Microsoft.SqlServer.Smo)
Additional information:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
Directory lookup for the file "C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\AdventureWorks2012_Log.ldf" failed with the operating system error 3 (The system cannot find the path specified.). (Microsoft SQL Server, Error: 5133)
My instructions say to attach the database to C:\programfiles\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Data . However despite completing the exact same installation as the guide I don't have a MSSQL11.MSSQLSERVER path, only the C:\programfiles\Microsoft SQL Server\MSSQL11.MSSQLEXPRESS\MSSQL\Data like I stated earlier.
Is this where my problem lies? If so, where should I be putting the .MDF file before I attach it? Any ideas will be much appreciated
First of all, you are attaching the files to your database server, not Management Studio.
Second, your error is about a log file missing. You actually donĀ“t need the LDF just to attach the file, but you need to do some work to make it happen:
USE [master] GO
-- Method 1: I use this method
EXEC sp_attach_single_file_db #dbname='TestDb',
#physname=N'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\YourDBFile.mdf'
GO
Or, you can also do this:
CREATE DATABASE TestDb ON
(FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\YourDBFile.mdf')
FOR ATTACH_REBUILD_LOG
GO
The error message is saying the LDF file is missing. You need both the MDF and the LDF.
You can click the second file with type is LDF and hit "Remove"

Unable to connect to SQL Server 2008 R2

I am unable to connect to a local SQL Server 2008 R2 trial version from Visual Studio 2010 Express.
When adding a new connection, I browse to the database file in this location:C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\DATA\AdventureWorks_Data.mdf, I encounter this error:
Could not open new data base 'C:\PROGRAM FILES\MICROSOFT SQL
SERVER\MSSQL10_50.SQLEXPRESS\MSSQL\DATA
ADVENTUREWORKS_DATA.MDF'.CREATE DATABASE is aborted. An attempt to
attach an auto-named database for file C:\Program Files\Microsoft SQL
Server\MSSQL10_50.SQLEXPRESS\MSSQL\DATA AdventureWorks_Data.mdf
failed. A database with the same name exists, or specified file cannot
be opened, or it is located on UNC share. File activation failure.The
physical file name "C:\Program Files\Microsoft SQL
Server\MSSQL10_50.SQLEXPRESS\MSSQL\DATA\AdventureWorks_Data_log.ldf"
may be incorrect.
The log cannot be rebuilt when the primary file is read-only.
Another guess, you don't by any random chance have another user logged into the same machine that would have the DB file locked by connecting to it in the same way you say you're trying to? I'd imagine the previous comment about that database file already being attached to by the sql service is probably far far more likely, but just for wild chance I'm leaving my idea here for you or anyone else who happens by