Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6573853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:11:09+00:00 2026-05-25T15:11:09+00:00

I was wondering what the best approach would be to restoring a single record

  • 0

I was wondering what the best approach would be to restoring a single record from an MDF file (generated as backup on the live instance) into the live SQL Server database.

I know about the process of attaching the file to the database and have read quite a bit about completely restoring, but how about selecting a single record from one of the tables and inserting it back into the same table on the live instance?

I could always create the new record from scratch myself based on the resulting row from the select statement, but I am sure that there has got to be a smarter and cleaner approach to such a simple task.

Thanks a bunch in advance, looking forward to your answers.

Cheers.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T15:11:10+00:00Added an answer on May 25, 2026 at 3:11 pm

    Depending on what kind of flexibility you have on the live server, you could always just attach the backup database under a different name on the live or another linked server and then just select the record you want straight in to the equivalent table in the live database.

    How viable this is depends entirely on the primary key. If it is an auto-generated identity column, selecting it in will give a different primary key which may have undesirable results on any linked records you may also want to add, the new primary key would have to be taken in to account.

    Example of query

    insert into originaldb.dbo.Persons 
    select * from backupdb.dbo.Persons where PersonId = '654G'
    

    originaldb.dbo.Persons is the original table that you want to select into.

    backupdb.dbo.Persons is your restored backup table.

    You’ll need to modify this query a little if you are not selecting the entire row but that is the gist of it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am wondering what would be the best approach to store, for let's say
I was wondering what would be the best approach for creating tables in a
I was wondering how one would best approach the task of deciding upon the
I was wondering what would be the best approach towards finding the index of
I was wondering what the best approach would be to the following problem. Say
I am wondering what the best approach would be to check whether or not
I am wondering what would be the best approach in a WPF (possibly MVVM)
I was wondering what the best approach would be for the following situation: I
I was wondering what would be the best approach to split up array processing
I was wondering what would be the best approach to make a Grails app

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.