How to recover deleted attached mdf file from sql server management studio

Hi everyone
I've faced very bad problem
I had a mdf file that created in visual studio, and then I had attached this file to sql server management studio and after that, when I wanted to deattach
this file I had a big mistake; and deleted the mdf file; then now this file was deleted from my computer
I test several recovery tools but they can't find deleted mdf file; the volume of the mdf file was more than 2 GB.
Please help me if you can

Hello,
If you don't have a backup of the database, then it's not really possible to get it back. There are some "Undelete" Tools available for Windows, but when even only one page was overwritten on disk, then it's not possible to recover it.
Olaf Helper
[ Blog] [ Xing] [ MVP]

Similar Messages

  • How to attach .mdf file to sql server 2008 EXPRESS

    I have .mdf files created using SQL SERVER management studio 2012 in another computer and wish to attach the same to SQL SERVER 2008 EXPRESS in another computer. How should I do so? I tried this method :How
    to: Attach a Database File to SQL Server Express but then it shows an error that the database cannot be created due to compatibility issues.
    Msg 948: The database xyz cannot be opened because it is version 706. This server supports version 655 and earlier. A downward path is not supported..
    Any help??

    I have .mdf files created using SQL SERVER management studio 2012 in another computer and wish to attach the same to SQL SERVER 2008 EXPRESS in another computer. How should I do so? I tried this method :How
    to: Attach a Database File to SQL Server Express but then it shows an error that the database cannot be created due to compatibility issues.
    Msg 948: The database xyz cannot be opened because it is version 706. This server supports version 655 and earlier. A downward path is not supported..
    Any help??
    You are trying to attach SQL Server 2012  database files to SQL Server 2008 R2 which is not allowed, you either need to upgrade your SQL Server 2008 to 2012 or alternatively you can generate all scripts from SQL Server 2012 and execute it in SQL Server
    2008 R2.
    You can refer below link to how to generate script.
    http://blog.sqlauthority.com/2012/07/18/sql-server-generate-script-for-schema-and-data-sql-in-sixty-seconds-021-video/
    Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
    Praveen Dsa | MCITP - Database Administrator 2008 |
    My Blog | My Page

  • Cannot navigate to some folders when attempting to attach .MDF files to database in Management Studio

    Hello,
    I have Windows 7 ultimate, SP1 and login to a SBS2003 R2 domain as administrator.
    I use SQL Server Management Studio 10.50.2500.0 to connect to a local instance of SQL Server 2008 R2 using Windows Authentication.
    When I attempt to attach a database .MDF file that is not in the C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\DATA folder, the Locate Database Files dialog box will not allow me to navigate to other folders to find databases.
    It does not give an error, it simply does not open the selected folder.
    How do I allow the Locate Database Files dialog box to navigate to other folders to locate other .MDF files?
    Any help would be grate fully appreciated.
    Thanks,
    Tony
    Stop The World, I want To Get Off! ........... Life Isn't About Waiting For The Storm To Pass ... It's About Learning To Dance In The Rain.

    Hello Naomi.
    I’m not sure of what you mean by “the rights”, but I can see all folders and files on all machines when using Windows Explorer.  I cannot navigate to them through the Locate Database Files
    dialog box.
    Also, this has nothing to do with the server.  This issue involves my local computer.
    Thanks,
    Tony
    Additionally, your question came to me as an email from
    [email protected]  I tried to reply to it and it came back as undeliverable.  So, I posted my reply here
    Stop The World, I want To Get Off! ........... Life Isn't About Waiting For The Storm To Pass ... It's About Learning To Dance In The Rain.

  • Problem attaching mdf file in sql server 2008

    hi...!
    I have an mdf file of sql server 2005 database now i want it to attach in sql server 2008 R2 but when i try to attach it, it gave me error saying.
       Fail to retrieve data for this request. 
     An exception occur while executing a Transact-SQL statement or batch.(Microsoft.sqlServer.connectionInfo)
    C:\program files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\file6.mdf is not a primary database file. (Microsoft SQL Server, Error:5171)
    Thanks in advance

    hi...!
    I have an mdf file of sql server 2005 database now i want it to attach in sql server 2008 R2 but when i try to attach it, it gave me error saying.
       Fail to retrieve data for this request. 
     An exception occur while executing a Transact-SQL statement or batch.(Microsoft.sqlServer.connectionInfo)
    C:\program files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\file6.mdf is not a primary database file. (Microsoft SQL Server, Error:5171)
    Thanks in advance
    Hello,
    As the message says the file is not primary data file ,i guess it must be ndf(secondary data file) or some other file you might have selected by mistake.PLease select primary data file and try attching you will succed
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

  • Import multiple files using sql server management studio

    Using sql server management studio I want to do 2 things.
    - Import all txt files from a directory as tables into my DB.
    - Add an additional field to each new table which contains the table name.
    Can anyone help me?

    There are couple of ways to do it:
    File naming conventions : YourFileName_SystemId.txt
    You can create one extra column in table or may be name a table with system id. Then after loading the data you can update that column with the system id.
       components required:
     ForEachLoopContainer - To get file and store file name in a variable
     Expression Task (if SSIS 2012 or above) or variable expression or script task to seperate file name from systemId
     Data Flow Task - to load data
     Execute SQL Task - to update last column or specific table based on precedence constraints  
    Note: You can also add extra column in data flow via
    derived column transformation.
    Ex.:
    Load file via foreach loop
    Split string via seprator
    2: Loading different system file in different folder
    you can have predefined folder structure ex: SystemId1, SyetemId2 etc and can download respective txt file in their system folder. Then you can easily identity which file belong to which system and then load it to the respective table.
    3: Use first row of text file to hold the system value
    Use first row to have the system id and then skip row while fetching data. 
    Note: Then you have to read first row through script task to get the system id.
    hope this will help

  • How to find a record then edit using sql server management studio

    Hello,
    A very basic question:
    I want to find a record stored in MS SQL Server 2008 express database table then edit the record.
    I tried to do it using SQL Server 2008 management studio express because I have been using MS Access database all the time. I have right clicked the table in management studio, clicked the "Edit top 200 records" menu item then when records were
    displayed on the result pane, I pressed Ctrl + F key to find a student named Simon for example. Well, nothing happened. I couldn't see any dialog boxes for putting in the search criteria.
    I guess I cannot simply use Ctrl+F in SQL Server management studio to find / edit a record.
    Can someone please teach me how to find a record specifying a search criteria then edit the record in SQL server management studio?

    Hi ZKM128,
    I have not seen Ctrl+F to be used to look for desired rows in Sql server.
    On the result pane after you selected "Edit top 200 records", just right click , select
    PANE, SQL, you will get the T-Sql query t,here you need to mention the exact criteria which you are looking for, and then you will get the desired rows and then you can edit.
    Thanks
    Manish
    Please use Marked as Answer if my post solved your problem and use
    Vote As Helpful if a post was useful.

  • Remove Deteled Databases from SQL Server Management Studio List

    Hi,
        I am using SQL Server Express 2008 Management Studio & in the databases list are some databases that are non existent (have been deleted in Windows Explorer). How do I remove them as trying to delete when logging in using Windows authentication
    fails?
    Thanks
    Paul.
    Paul Wainwright

    Hi pr_wainwright,
    I’m writing to follow up with you on this post. Was the problem resolved after performing our action plan steps? According to your description and error message, we need to verify if your windows login account has sysadmin permission. The error 3701 occurs
    when you use an account to execute the script who has not grant the permission about modifying database properties and creating database. I do a test, when the SQL Server Service is stop, I delete the data and log file of database from Windows Explorer, then
    restart the service again, and connect to the SQL Server instance via windows login account which is sysadmin role. In SSMS list, you can right click the database and choose “ delete” option. Or you also use the drop statement by using master database first.
    and two ways can all run well.
    Regards,
    Sofiya Li
    If you have any feedback on our support, please click here.
    Sofiya Li
    TechNet Community Support

  • Can't Remove Datasets From SQL Server Management Studio Restore Database Dialog

    Hello,
    I am trying to restore a database in MS SQL 2008 R2 Management Studio on a Windows 2008 server.
    - I right click the Databases folder and choose Restore Databases.
    - I select the From device radio button as usual and click Add.
    - I specify a .bck file as usual and click OK.
    - When I return to the Restore Database dialog are two backup sets already in the "Select backup location to restore" part of the dialog that I unsuccessfully tried to restore earlier already there.
    - I can see the path to the backup set that I want to add in the "From device" field of the "Restore Database" dialog. The backup is not listed in "Select backup location to restore" as it should be.
    - I tried restarting the SQL Server service and I rebooted the server but the files were still there when I tried to do a restore.
    - There is no option to remove the extra datasets in the "Select backup location to restore" part of the dialog. I am hoping that if I can remove the extra datasets that this will resolve the problem. Does anyone have any idea how to remove them?
    Martin Mann

    Hello,
    My issue was a bit different then your screenshot. I was able to choose a backup dataset with no problem from the "Select backup devices" dialog as you show in the screenshot. At that time the "Restore Database" dialog box you show in the background had
    no backup files, you show filetest1, filetest2. However after clicking the "Add" to files were listed in the "Restore Database" dialog neither of which was the one that I was trying to add. The problem was that the wrong files were listed in the "Restore Database"
    dialog and I couldn't remove them.
    The problem turned out to be two issues. I resolved the problem as follows:
    It turned out that someone had compressed my server c:\ drive and I was not aware of it. Disk compression and SQL server have conflicts. As I had never compressed a drive I didn't know that Windows Explorer displays compressed files in blue letters. So the
    first step was to decompress the drive. Which did not fix the problem.
    What had caused the files to show up was that I had somehow created a backup with two data sets in it. It seems that when SQL Server creates a backup one of the first things it does is check the drive for the required space and create an empty backup file
    the size of the backup to reserve the disk space. It seems that I had created a file that contained space for a backup but no data with another back with data behind it. When I looked at the backup file size in explorer it was almost twice the size it should
    have been.
    I resolved the problem by changing the path of the default backup folder. I was able to do a restore from there. Afterwords the default backup folder worked and the files listed were no longer there.
    Sorry for the confusion and thanks for the help.
    Martin Mann

  • Deleted User Master Data with SQL Server Management Studio

    Hi All
    I've, recently restored an ECC 6.0 backup onto a test system. In an attempt to quickly delete most of the User Master Data from the source system, I deleted the User ID's from the USR02 table using SQL Management Studio.
    But within Transaction su01, the User ID's that were deleted that way, still show up in the "F4" search. I can select one of those deleted ID's, but get an informational pop up stating that the user does not exist, if I go to display.
    Does anyone know of a quick way to delete these User ID's from the "F4" search pop up?
    The only way I've found so far is to select the User ID, recreate it and then delete it from the su01 transaction. This is going to take me hours.
    Tried to save time, but caused more of a head ache.
    Ken

    Thanks Brian
    Yes, I have done this in the past as well. Although for this instance, I needed to keep about 20 of the 100 + User ID's that were in the system, and was hoping for an easy way to do it.
    In Table USR02, it was easy to pick all, but the 20 and delete. (Sometimes we think we're smarter than we really are I've since spoken to a Security team member and found out about there's a way to do "Mass" changes in transaction su01.
    tcode us01 -> Environment -> Mass changes.
    Ken
    Live - Learn - Laugh

  • How to create a composite nonclustered index using sql server management studio

    Hi,
    How do I create a composite non clustered index using Manage Index and Keys dialogue box?
    sukai

    See image below:
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Database Design
    New Book / Kindle: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2014

  • How to delete the Generated files from application server(open hub)?

    hi experts,
    when i try to execute process chain the DTP it is giving below dump. Exception CX_RSBK_REQUEST_LOCKED logged.
    when i execute the DTP manually and trying to delete the previous request, it is giving for dump ITAB_DUPLICATE_KEY.
    so to delete the generated file from application server, how to delete it for specific dates?
    Information on where terminated
    Termination occurred in the ABAP program "GPD6S3OE0BCVGC6L9DBNVYQARZM" - in
    "START_ROUTINE".
    The main program was "RSBATCH_EXECUTE_PROZESS ".
    In the source code you have the termination point in line 2874
    of the (Include) program "GPD6S3OE0BCVGC6L9DBNVYQARZM".
    The program "GPD6S3OE0BCVGC6L9DBNVYQARZM" was started as a background job.
    and when i check the dump it is point out at below code
    " Populate the lookup table for 0STOR_LOC
    SELECT * from /BI0/TSTOR_LOC
    into CORRESPONDING FIELDS OF table L_0STOR_LOC_TEXT
    FOR ALL ENTRIES IN SOURCE_PACKAGE WHERE
    STOR_LOC = SOURCE_PACKAGE-STOR_LOC.
    but the programme is syntactically correct only.
    how to rectify the issue.
    regards
    venuscm
    Edited by: venugopal vadlamudi on Sep 28, 2010 1:59 PM

    hi experts,
    We have written start routine to get the storage location text and sending to File located at Application server through OPEN HUB.
    here is the code written in the Transformations
    In the global section
    Text for 0STOR_LOC
        DATA: l_0stor_loc_text TYPE HASHED TABLE OF /bi0/tstor_loc
              WITH UNIQUE KEY stor_loc.
        DATA: l_0stor_loc_text_wa TYPE /bi0/tstor_loc.
    and in the code to get the text
    " Populate the lookup table for 0STOR_LOC
        *SELECT * from /BI0/TSTOR_LOC*
          into CORRESPONDING FIELDS OF table L_0STOR_LOC_TEXT
          FOR ALL ENTRIES IN SOURCE_PACKAGE WHERE
                  STOR_LOC = SOURCE_PACKAGE-STOR_LOC.
    im sure there is problem with the Routine only. i think i need to change the code if so please provide me the modified one.
    thanks
    venuscm
    Edited by: venugopal vadlamudi on Sep 29, 2010 9:37 AM

  • How can I delete two .jpg files from my desktop that refuse to be deleted?

    How can I delete two .jpg files from my desktop that refuse to be deleted?

    The two icons refused to be moved to the garbage. The good part in all this is that ater I turned off the computer at night and turned it back on the next morning they were gone!
    Thanks.

  • How can I delete hidden video files from the iPad?

    How can I delete hidden video files from the iPad?  These files were created on my MBA and when I changed the media type to iTunesU and then copied it to my iPad via iTunes, they did not appear.  I can see them using 3rd party software, but they don't have delete functionality.
    Thanks
    York

    Interesting note:  I can see the files when I use the search function, but when I tap either file, I return to my home screen.  The video does not open.  I can transfer the file to my MBA, and it plays fine, but I cannot figure out a way to delete them.

  • HT1391 How does one delete apps or files from iCloud Permanently so I may re-download without retrieving existing cloud file?for example the U2 Marketing fast , an Album I have no interest in...is now in my Cloud.. How can I remove this File from iPhone &

    How does one delete apps or files from iCloud Permanently so I may re-download without retrieving existing cloud file?for example the U2 Marketing fast , an Album I have no interest in...is now in my Cloud.. How can I remove this File from iPhone & cloud

    Hey there Matt.dvs1,
    Although there is not a way to remove past purchases from your iTunes account completely, you can hide them so that you don't have to see them if you don't want to. This article will help you do that:
    iTunes Store: Hiding and unhiding purchases - Apple Support
    Hide your purchases
    Open iTunes on your Mac or PC.
    From the Store menu, choose Store > Sign In, and then enter your Apple ID and password.
    Go to the iTunes Store.
    Click Purchased from the Quick Links section on the right side of the iTunes Store.
    Choose a content type by clicking Music, Movies, TV Shows, Apps, or Books from the top of the window.
    A list of your purchased items for the content type you are viewing will appear. Mouse over the item you want to hide until an X appears its top-left corner.
    A confirmation dialog will appear once you click the X.
    Thank you for using Apple Support Communities.
    All the best,
    Sterling

  • How can open a html, pdf files from the server (c:\foldername\filename)

    Hi all,
    I am developing an application. in this app i have to implement RMI.
    My problem is this, How can a client open a files from the server.
    all the html, pdf files are stored in the server's directory like C:\audit\filename.
    There is a folder on the server's C directory which contains all the html , pdf files.
    please tell me how can a client open a file from the server using RMI.
    Please send me the solution as soon as possible.
    Thanks & Regards
    Bhavishya

    That's doing it the hard way. Why not use HTTP or FTP?

Maybe you are looking for

  • Problem with the Browsing of Services Registry in Visual Composer

    Hi, I have tried to connect Visula Composer of CE 7.1 to the Services Registry for ES Workplace by configuring 3 Web Service destination on my local server: 1. UDDI_DESTINATION 2. CLASSIFICATION_DESTINATION 3. Backend destination "HU2" as stated in t

  • Bug in viewCDZDocument.jsp?

    When the 'refresh on open' option is clicked on, viewCDZDocument.jsp calls getPrompts.jsp. We modified getPrompts.jsp to access the document's data providers. This puts the system in some weird state where it doesn't think there is any data returned

  • KM installation

    Hi All    We are working on EP5.0.Our client does not want to upgrade to 6.0 but wants to implement KMC.I am new to EP.Can anyone help me find the related docs for installing KM and collaboration on 5.0. Thanks in advance Swetha

  • Lenovo Synaptic Untranav not working

    Hi I just got a new X1 carbon. One fine morning the synaptic Ultrnav stopped working. It said, unable to connect to synaptic ultranav, when I went to mouse(but could se the tab). Then I uninstalled the driver and rebooted. I downloaded the driver for

  • Illustrator pictures appear/disappear in InDesign CC?

    I'm importing two Illustrator CC pictures into an InDesign CC file (Running Adobe CC on Mac OS X 10.8.5). If I set my display preferences to "Normal", they show up correctly (although an imported Photoshop JPEG appears in low-res). If I put the displ