?
Solved

tool for running SQL script remotely...

Posted on 2011-09-08
6
Medium Priority
?
310 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
Independent Software Vendors: 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 2000 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

Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

Question has a verified solution.

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

One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
MSSQL DB-maintenance also needs implementation of multiple activities. However, unprecedented errors can hamper the database management. In that case, deploying Stellar SQL Database Toolkit ensures fast and accurate database and backup repair as wel…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Suggested Courses

840 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