Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to query SharePoint list data from a database named like STS_bangbus_1 database, but there seem to be only one SQL Server instance with the named “bangbus” aka “SHAREPOINT”, with duplicated database file names in two different directories: C:\Program Files\Microsoft SQL Server\MSSQL$SHAREPOINT C:\Program Files\Microsoft SQL Server\MSSQL$SHAREPOINT\DATA

The latter is the default spot for the SharePoint list databases and has the much, much larger database file, likely with the current data. I suspect that someone made a backup copy in the parent directory (in Feb 2010?), which would be fine, except now we cannot query the AllList and AllUserData tables (in the lower directory) as we require.

Will deleting the backup database copy in the parent directory solve the issue? Can we delete these copies? If not, how can we query these two data tables to meet our requirements?

Any suggestions or advice would be most welcome.

PS It is an actual point in time copy of the mdf file in the parent directory. The working, active mdf in the child/default is not connected to the identically named database.


migration rejected from Sep 27 '13 at 17:15

This question came from our site for professional and enthusiast programmers. Votes, comments, and answers are locked due to the question being closed here, but it may be eligible for editing and reopening on the site where it originated.

closed as off-topic by Max Vernon, RolandoMySQLDBA, dezso, bluefeet, Kin Sep 27 '13 at 17:15

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Too localized - this could be because your code has a typo, basic error, or is not relevant to most of our audience. Consider revising your question so that it appeals to a broader audience. As it stands, the question is unlikely to help other users (regarding typo questions, see this meta question for background)." – Max Vernon, RolandoMySQLDBA, dezso, bluefeet, Kin
If this question can be reworded to fit the rules in the help center, please edit the question.

I wouldn't delete anything until we straighten this out. When you say "backup database copy" what type of file are you talking about? .mdf/ndf/ldf ? Or .bak/trn/dif or something else? – Mike Walsh Dec 6 '12 at 3:07
Also when you say "we cannot query..." what do you mean? Errors? Missing database? Describe the problem a bit more, please. – Mike Walsh Dec 6 '12 at 3:08
We are querying the old copy of the database in the parent directory. – Todd O Dec 21 '12 at 22:49