Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Express Edition and Compact Edition (2005)
 link a db to SQLExpress

Author  Topic 

fabianus76
Posting Yak Master

191 Posts

Posted - 2005-12-03 : 09:04:52
I just reinstalled SQLExpress and all the dbs that I created are no more linked. The files still exist in the folder where the current version stores dbs (...\Microsoft SQL Server\MSSQL.1\MSSQL\Data\) but they are not "linked" (don't know the right term).

Is there anybody who could help me how to "relink" these dbs to the actual .\SQLExpress instance?

Thank you very much for any help!

Regards,
Fabian

my favorit hoster is ASPnix : www.aspnix.com !

mikewa
Microsoft SQL Server Product Team

84 Posts

Posted - 2006-01-26 : 13:59:03
Hi Fabian,

You can attach your database files a number of different ways depending on your preference. Here are two:

1. Use the CREATE DATABASE T-SQL statement with the FOR ATTACH option. You can find this documented in the BOL at http://msdn2.microsoft.com/ms176061.aspx. Check out Sample E for a specific example of attaching. You would execute this command using a tool such as SQLCmd.

2. If you prefer to have a UI to do your work, you can attach a database using SQL Server Management Studio Express, which is available as a CTP download at this time. You can get SSMSE CTP from http://www.microsoft.com/downloads/details.aspx?familyid=82afbd59-57a4-455e-a2d6-1d4c98d40f6e&displaylang=en. Once you connect to your server, just right-click on the Databases folder and select the option to Attach a database.

Hope this helps you out.

Regards,
Mike Wachal
SQL Express

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
Go to Top of Page

fabianus76
Posting Yak Master

191 Posts

Posted - 2006-01-27 : 08:15:03
Hi Mikewa,

thank you very much for this help!

Regards,
Fabian

my favorit hoster is ASPnix : www.aspnix.com !
Go to Top of Page
   

- Advertisement -