Solved

tool for running SQL script remotely...

Posted on 2011-09-08
6
301 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
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 
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

[Webinar] Disaster Recovery and Cloud Management

Learn from Unigma and CloudBerry industry veterans which providers are best for certain use cases and how to lower cloud costs, how to grow your Managed Services practice in IaaS clouds, and how to utilize public cloud for Disaster Recovery

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Designing and Implementing a Data Warehouse 3 17
SQL Server - Slabs 9 40
Generate Weekly Schedule 15 17
Trying to identify overlapping date ranges 5 16
In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
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.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to shrink a transaction log file down to a reasonable size.

867 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now