How can I use the DASP .bak file directly into SQL Server?

Discussion in 'Databases' started by PJ2010, Nov 26, 2011.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Can I import the .bak file directly into SQL Server 2008? I made some changes in my online database, and now I wonder how I can download it and use it from SQL Server 2008? Do I just change the .bak extension to .mdf?
     
  2. RayH

    RayH DiscountASP.NET Lackey DiscountASP.NET Staff

    For your DiscountASP.NET database, you can use the tools in the Control Panel to make a backup. Once downloaded, you can either use the SQL Server Management Studio GUI to perform a restore to your local SQL Server instance or execute a T-SQL command:

    http://msdn.microsoft.com/en-us/library/ms186858.aspx

    Please note you cannot do this for your online database. If you wish to perform a restore, you will need to use the tools in the Control Panel.
     
  3. Thanks...can you please help me a bit more?

    Can you please tell me how to use Microsoft SQL Server Management Studio to restore this database, once I have downloaded it from DASP?

    I am using Windows 7. I have the below info. I'm a noob about this stuff, though I program with databases all the time for years now. Sorry if I appear to be a professional basketball player who cannot dunk the ball, but that's life!

    So in the free version of Microsoft SQL Server Management Studio under File|Connect Object Explorer I have two choices, Database Engine, and SQL Server Compact. Is this free version of Management Studio perhaps crippled? (since I don't see other choices). Now if I pick Database Engine, it wants to connect to various system server names like "MyComputerName", etc, but I get the error message:

    ("TITLE: Connect to Server
    ------------------------------

    Cannot connect to MyComputerName

    ------------------------------
    ADDITIONAL INFORMATION:

    A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 2)

    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=2&LinkId=20476

    ------------------------------
    BUTTONS:

    OK
    ------------------------------

    Perhaps I have to reboot? I will try that later. I notice the DASP database was not a Windows Authentication but a SQL Server Authentication. So do I choose that drop down box, then perhaps browse to what? The .BAK file I downloaded?

    In the alternative to the above, can you please tell me how to restore this database from inside of Visual Studio 2010, Professional (which itself may not support things done in VS 2010 Ultimate version)? As you know, you can run T-SQL commands from there...but, you have to attach something first.

    So inside of Visual Studio 2010 Professional, as I'm sure you are aware, you can attach to a server or a database file, but as a .BAK extension the file I downloaded from DASP is not recognized. Can I somehow convert this .BAK file to a Microsoft SQL Server database file or ODBC Data Source or something that the VS 2010 tool will recognize?

    Any third party tools I can use? It's a crying shame this is not somehow easier for noobs like me.

    PJ

    My Microsoft SQL Server Management Studio version below (it might be crippled compared to your version)


    Microsoft SQL Server Management Studio 10.50.1617.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
     
  4. dmitri

    dmitri DiscountASP.NET Staff

    To connect to your local default instance of SQL Server on your desktop machine, in the "Connect to Server" dialog box of your Management Studio, please type the following in the "Server name" field, including the parenthesis:"

    (local)

    Once connected to your local sql server instance, please follow the instructions in this Microsoft article to restore the backup file:
     
  5. Won't work--I think my Management Studio is crippled

    Thanks Dimitri, but it does not work--possibly because the Management Studio is crippled. For instance, I can log onto My_MachineName\SQLEXPRESS (SQL Server 10.4000)

    But when I try a drop-down box (and my SQL Management Studio is for SQL Server 2008 r2, which is what I have on DASP, but I'm not sure I have this SQL Server on my localhost--perhaps it's SQL Server Express, if that makes sense), I have just these two options: "Database Engine" and "SQL Server Compact". That is all.

    Trying to open (localhost) is futile, using Windows Authentication, I get the error message: "A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (.Net SqlClient Data Provider)"Cannot connect to (local)."

    When I try to open, using "Open" a known, good database (ending with .mdf) that I can open inside of Visual Studio 2010 Professional (which is crippled for database functionality compared to VS10 "Ultimate" edition), I get the error message: "There is no editor available for [database path and name].mdf. Make sure the application for the file type (.mdf) is installed".

    I think this is hopeless--I pretty much have given hope on trying to manage the database from my local machine, which is unfortunate. Unless we can find some "third party tool"? Again it might be because of the freeware I'm using (Management Studio--for free, and VS 2010 Pro, which is crippled somewhat for databases).

    As I say, I can sign onto My_MachineName\SQLEXPRESS (SQL Server 10.4000), using the Management Studio tool, so it's working somewhat.

    Any other ideas welcome; thanks you've been very helpful in the past (and I can still send you a Greek gift of drachmas...lol they are coming back, you wait and see).

    PJ
     
  6. RayH

    RayH DiscountASP.NET Lackey DiscountASP.NET Staff

    First of all, make sure you are using the SQL Server 2008 R2 Express version:

    http://www.microsoft.com/download/en/details.aspx?id=23650

    The Version number is 10.50.1600.1

    When you connect to SQL Server Express on your local machine, make sure the instance is running:

    1) Go to the Start Menu -> Administrative Tools -> Services
    2) Make sure SQL Server (SQLEXPRESS) is Started.
    3) Make sure you place the backup file in C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\Backup
    4) Right click on the Databases folder in SQL Server Management Studio and click on Restore Database...
    5) You can then fill out the GUI to restore the database.

    Another note: Make sure you do not have any antivirus/firewall software running or open up port 1433 to allow access to the SQL Server instance.
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page