Group,

I may have messed up bad. I need help.

I was having trouble loading a database I had created with data. So I downloaded SQL Server 2008 Express that included the management tools. I tried to find and open the created database and never could find it using the management tools. So I then opended Visual Studio 2010 and tried to access the database there. I'm getting an error message that says, "Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed". Would someone know what has happened and how to fix it? I've put a tremendous amount of work into this and I don't want to loose this.

In advance, thanks for your help.

Don

If you can determine the path of your database files from within VS, you should be able to attach to the DB easily from SQL Mgmt Studio.

I'd recommend that you keep a copy of the DB files before making any changes.

If you've installed SQL Management Studio then you can find the current location of your files by right clicking the server instance in the left pane and selecting Properties. Select Database Settings in the window that appears and the folders for Data and Logs will be displayed. You can attach your database files from their current location, or you can move or copy them to the displayed folders. You can attach the database files to the new server instance using sp_attach_db (which will eventually go away as it has been deprecated but still works for now). The syntax is

sp_attach_db 'dbname','datafile','logfile'
sp_attach_db 'PUBS','D:\SQL\DATA\PUBS.MDF','D:\SQL\DATA\PUBS_LOG.LDF'

Using the PUBS database as an example

Since I've never used SQL Management Studio, here's where I'm at:

From the Window's start button, I chose SQL Server 2008. Then I chose SQLServer Management Studio. The "Connect to Server" box comes up. There 3 drop down boxes that appear: Server Type (Database Engine), Server Name (Local, Browse for more, and Don-PC/SQLEXPRESS) and Authentication (Windows Authentication). I'm stuck here. I'm not sure what to chose. I've tried all the choices but I can't seem to find the right way to get to Database Settings.

I have found the path of the database I'm looking for a different way. But getting to the "server instance" is still foreign to me. I hate to have you hold my hand, but I need you to.

Don

For Server Type you want to pick Database Engine. That should be the default. For Server name you should select Don-PC\SQLEXPRESS. And for the last box, take the default of Windows Authentication. Then click Connect. Once you have connected and get to the main screen you can proceed as I stated in my previous post. Let me know what happens.

OK. I was able to copy and paste into the object explorer. Thanks for the help.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.