Beginner questions

  • Hello everyone and thank you for joining the forum.

    I am new to SQL and have a few beginner questions.

    1. i have installed Microsoft SQL Server and SSMS as well.

    I just did it and got it to work and I can write queries in SSMS. Unfortunately I don't know if I forgot something important during the installation, because it was quite complex. Do you have any tips on this?

    2. i was wondering where a database is stored in Microsoft SQL (SSMS)? Is it stored locally on my PC or in a “cloud”? I am asking because I have created several databases but cannot find them again after saving. And what happens if I switch to a new computer?

    Many thanks for your answers

     

  • In SSMS, you can right-click on any database in the 'Object Explorer' window and get Properties. Within the Properties window, there is a Files node - click on that and you will see where the files are stored. Databases are stored locally by default, though SSMS can access databases on servers and in the cloud too.

    Companies tend to have SQL Server installed on a server, so that the same databases can be accessed by many people at the same time.

    If you switch to a new computer, you will have to somehow transfer any databases stored locally to that computer. BACKUP/RESTORE is a good way of doing that.

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • I just wanted to point out that IF this is installed on your primary use computer, I would strongly encourage you to configure the max memory to a lower value - default is 2 PB and I doubt your computer has that much. If you don't reduce it, you will find that your RAM on your computer gets used up eventually and the computer starts running horribly. I would set this to a number that makes sense for your system and use of SQL Server. I would also set MAXDOP to 1 so SQL doesn't eat up all of your CPU cores while you run a query. This won't stop SQL from using up all of your cores if multiple queries are run, but it ensures that queries being run will only use 1 core per query.

    Last bit of advice, I would use SQL Server Configuration Manager to stop the SQL instance when you are not using it IF it is on your primary computer as you will notice a performance impact of having SQL running all the time.

    As Phil said, a backup/restore is a good way to migrate to a new machine. An alternate way is to copy/paste the mdf/ldf files to the new computer then attach the database to the SQL instance on the new machine. Not ideal as copy/pasting mdf and ldf files requires the database to be offline, but if this is all running on your local box and only used by you, that shouldn't be a big deal.

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

  • Practice doing BACKUP / RESTORE before you actually need to. Save your backups in another location in case your PC crashes.

  • Thank you very much for the great replies. That helps a lot.

Viewing 5 posts - 1 through 4 (of 4 total)

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