tags:

views:

698

answers:

3

I have a SQL Server Primary Database file. (.mdf)

I require a program which can open the file and let me edit some data.

Since there are many fields, it tedious to open all the records and modify it.

Would it be a good idea to do so? I can always take backup of .mdf file before playing with it, since I do not have any programming knowledge.

+4  A: 

Download SQL Server Management Studio Express and write an update query to change the required fields.

I can almost guarantee that editing the MDF file directly is risky to your data and not supported in any way by Microsoft.

If you have no programming knowledge you should get someone who does to write the update query for you. Alternatively you could read up on basic SQL yourself. Most people can get working with simple SELECT and UPDATE statements quite quickly.

Here's a good simple introduction to the UPDATE statement.

Ash
Ash, I suppose my file is in SQL Server 2008, SQL Server Management Studio Express (Microsoft SQL Server Management Studio Express (SSMSE) is a free, easy-to-use graphical management tool for managing SQL Server 2005 Express Edition and SQL Server 2005 Express Edition with Advanced Services.). Would it be ok to use it? Secondly, can i install it on the same PC where my software and SQL Server 2008 is installed? btw, thanks for the answer...I will try I think it should help.
Vicky
Ash
You can install it on the same PC without any problems. However if you already have SQL Server 2008, you should also already have the full version of SQL Management Studio 2008. Check for it in your start menu.
Ash
Thank you Ash. SQL Server 2008 came with the company who made my personalised software. In Start Menu, there is Import and Export Data (64 Bit), Configuration Tools -> SQL Server Configuration manager, Error and Usage Reporting, Installation Center.
Vicky
A: 

Hi

I think it would help if you attach the .mdf file as a database in SQL Server and then play with the records in it.

cheers

Andriyev
+2  A: 

You can't update the data in an MDF file outside of SQL Server. The file format is not disclosed, and even if you'd manage to somehow make updates in it the integrity checks would at best cause the modified tables to be marked as corrupted, at worse place the entire database offline.

There is only one tool that can open and modify MDF files: a SQL Server instance of the appropriate version, as Ash has directed you. Before doing any modification to the database, I would highly recommend making a copy of the MDF and LDF files.

Remus Rusanu