running a script in sql

I have never done much in SQL with running scripts but I am supposed to run one today.  The instructions say I should run the .sql script against the Viewpoint database.  Viewpoint is the location of data for our accounting system.  See the screenshot and let me know where I should navigate to run the sql script.  The script is located on the desktop.
Screen-Shot-2018-01-18-at-7.36.25-AM.png
mkramer777Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bill PrewIT / Software Engineering ConsultantCommented:
Is this query just to report some data, or is it updating the database?


»bp
0
ValentinoVBI ConsultantCommented:
What you have selected there is indeed the viewpoint database.  If you hit CTRL-N with that selected SSMS will open a new query window on that database.  Anything you run from there will be on the viewpoint database, unless you use a statement that changes the database scope (such as "USE anoter_database").
0
mkramer777Author Commented:
Updating the database
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

mkramer777Author Commented:
Once it brings up the new query window how do I run the script?  Do I have to open it and paste the info or do I naviagate to the script on the desktop and click execute?

Also, where is the command or process to do a backup up the SQL database?
0
ValentinoVBI ConsultantCommented:
To be sure I'd open it in a text editor and copy/paste it into the query window.  Opening from SSMS is another option, just check that the right database is selected which is visible in the yellow banner at the bottom of the query window.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ValentinoVBI ConsultantCommented:
Once it is open you can hit F5 to execute.  There's also a button but in your screenshot most of the buttons are hidden so to keep it simple: F5 :)
0
mkramer777Author Commented:
You say once it is open.  Sorry to be a dope about this.  Is the only way to get this script in the query window is to copy and paste and then execute?  Or can you run it from the desktop to this location?
0
ValentinoVBI ConsultantCommented:
SSMS is the tool to work with SQL Server so yes, basically it is.  There's also a command prompt tool but I don't think that's what you're after.

As for the backup question, check this: Create a Full Database Backup (SQL Server)

BTW: I'm assuming you don't have a DBA around who will come and ask you why his backup schedule has been disturbed, right? If there is one, check with that person first!
0
Vitor MontalvãoMSSQL Senior EngineerCommented:
In SSMS, goto menu File/Open/File (or use the shortcut Ctrl + O) and locate you script file to be opened in SSMS.
Before running the script (F5 key) it's always good to perform a backup of your database so you can rollback to the moment immediately before you ran the script in case you need to revert the changes.
0
Vitor MontalvãoMSSQL Senior EngineerCommented:
mkramer777, do you still need help with this question?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
SQL

From novice to tech pro — start learning today.