opening a database

  • I am new to SQL.

    I successfully installed SQL server on a win10 PRO box at home.

    I connected to a SQL server instance on my home machine.

    I can create a database and work on it as described here:

    However, I want to investigate an already created database from another machine at my office.

    I want to be able to create custom reports from that data.

    This other database is from an application that creates and manages a schedule.

    It runs on a winPro box as well but is in constant use in 'production' so I cannot experiment on it there.

    I have copied the DATA folder from that other machine running SQL server to the desktop of my home machine.

    How do I open it ?

    I tried a real noob thing--

    Turned off sql server (in services) , replaced the DATA folder in here:

    C:\Program Files\Microsoft SQL Server\MSSQL15.LYTEC_SQL\MSSQL\DATA

    with the DATA folder I copied to the desktop.

    Restarting sql server gives me an error.

    Clearly I dont know what I am doing.

    Is there a link somewhere that will explain to me what to do so I can start this other database to explore it (names of the fields,etc) and write reports?

  • Thanks for posting your issue and hopefully someone will answer soon.

    This is an automated bump to increase visibility of your question.

  • skypickle wrote:

    I have copied the DATA folder from that other machine running SQL server to the desktop of my home machine.

    I reckon your best bet would be to take a BACKUP of the Source Database and then RESTORE that on your machine.

    When you do the RESTORE there are options to change the name of the database (you probably don't need to do that) but more importantly the location of the actual files.

    The default location puts them under "program files" as per your example

    C:\Program Files\Microsoft SQL Server\MSSQL15.LYTEC_SQL\MSSQL\DATA

    which I think is a dreadful choice.

  • Just a bit of advice... I know your intentions are honorable but there's no way I'd ever download a copy of a company database to a personal machine, if that's what you mean by "desktop of my home machine" even if I were sure that my security was better than the security at work.  I wouldn't be surprise if there's a company policy against doing so but the real key here is that if you download company data to a personal machine and they get hacked and they find out that you've downloaded the data to a personal machine, it's your head that's coming off at the chopping block.

    Don't do it.  Period.  It's not your data and your personal machine isn't a company machine.  Instead, have them setup a development environment at work.

    --Jeff Moden

    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.
    "Change is inevitable... change for the better is not".
    "Dear Lord... I'm a DBA so please give me patience because, if you give me strength, I'm going to need bail money too!"

    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • @JeffModen

    The company is MINE. In this day and age I am disappointed to how much work we delegate to others. I try to do my own basic office IT internally.

    BTW, I disagree with he whole concept of intellectual property. It is just a step away from the precepts presented in 'Fahrenheit 451'.  Is going to school to learn an example of theft of intellectual property? Why do we allow Pythagoras' theorem to be used by anybody and everybody? Is the the fact that Pythagoras is dead and there is no corporation to monetize it, the 'absent barrier' from using it? From a functional point of view, limiting access to learning is just creating a more illiterate workforce. This creates greater costs on business to 'train' their workers. Or greater cost to individuals to get 'certs' at their own expense (ballooning the educational debt)

    If 'privacy' is dead, isn't proprietary knowledge dead too? That rabbit hole cuts both ways.

    Certainly, knowledge should be trademarked so it cannot be resold. If someone benefits by taking raw data and reselling it, to others, that is bad. Knowledge, like speech, should be free. If you think that is anathema to capitalism, you are mistaken. I can still be paid for my effort as a human to implement that knowledge. Thank goodness there are more and more software giants espousing this. Linux is free. and complicated. That's why consultants can be paid and companies like Red Hat exist. Microsoft is realizing that 'community editions' should be free.


    SQL is like COBOL, an ancient religion whose existence is shrouded in complexity. To work on a database that is designed by McKesson is masochism. Their design is so full of cruft, deliberate obfuscation, and redundancy. You would vomit if you saw the tables. Even the names of the fields, dozens of which differ by one letter only, and give no clue as to the information they hold, is a major hurdle to understanding a product that I paid thousands of dollars for. The lack of keys in some of the tables is perplexing. The whole thing reminds me of a microsoft product from the '80s. Yet I am required to use it and as laws change requiring more and more complicated documentation from the data I manage, I have to pay thousands more just to get custom reports designed.


    Even more hilarious is the concept of HIPAA that our organization is saddled with. When you go out to get a sandwich, you cant miss people speaking about their health problems. Yet I even have to get a HIPAA certified and compliant consultant to do the work (adding even more cost to me) because the database contains health information. Even tho there is no financial info in it. Yet google, facebook and microsoft can more accurately predict what diseases you have by the sites your browser visits than I could by reading your data in the database we use.


    Many of the laws passed nowadays arise from abuses of knowledge and power by large organizations. Like laws that regulate the construction and management of large things like dams, bridges, buildings, nuclear weapons and roads. Individual humans are like ants before the impact of these babylonian structures. Sure, you wouldn't want a dam to fail and wipe out your whole town, but maybe dams should not be built near people anyway.  My point is becoming a philosphical diatribe against your paternalistic advice, do not take it personally. I see that you have done WAAY MORE THAN ME in helping people understand SQL and perhaps you have seen abuses that might have been prevented by your advice.

  • No need to get political or contentious. Jeff was raising valid concerns, based on the (lack of) information provided.

    • This reply was modified 6 days, 8 hours ago by  homebrew01.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply