Solved

tool for running SQL script remotely...

Posted on 2011-09-08
6
306 Views
Last Modified: 2012-05-12
I haven't had any experience with this, but I have a SQL script that I need to run remotely on one of my SQL servers. How can I run this on the remote server? Is there a tool or something so I can save the file as an .sql file and then run it from my machine?
0
Comment
Question by:willlandymore
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 28

Expert Comment

by:strickdd
ID: 36505485
You can use SQL server management studio, you just have you make sure that your SQL server allows remote connections and connect to that server from your management studio.
0
 
LVL 1

Author Comment

by:willlandymore
ID: 36505527
I can't really pop open the studio and then paste in the query and then run it manually, it would have to be automatic. Could I schedule this from within Management Studio like you can with backups, etc. and have it run every day if I save the query as a .sql file?
0
 
LVL 21

Expert Comment

by:JestersGrind
ID: 36505539
You can create a SQL job to run a script on a schedule.

Greg

0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
LVL 50

Accepted Solution

by:
Lowfatspread earned 500 total points
ID: 36505723
The utility you are looking for is called

SQLCMD

you execute from a windows command line

see

http://msdn.microsoft.com/en-us/library/ms162773.aspx
0
 
LVL 1

Author Comment

by:willlandymore
ID: 36506045
that looks like what I'm looking for as far as specifying the file and output file, but how can I schedule that one to run at certain times?
0
 
LVL 1

Author Comment

by:willlandymore
ID: 36506198
forget I asked... :)

I just put it in a batch file and then scheduled it and it was fine.

Thanks.
0

Featured Post

Comparison of Amazon Drive, Google Drive, OneDrive

What is Best for Backup: Amazon Drive, Google Drive or MS OneDrive? In this free whitepaper we look at their performance, pricing, and platform availability to help you decide which cloud drive is right for your situation. Download and read the results of our testing for free!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question