Solved

tool for running SQL script remotely...

Posted on 2011-09-08
6
305 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
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
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

726 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