Solved

tool for running SQL script remotely...

Posted on 2011-09-08
6
300 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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
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.

705 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

18 Experts available now in Live!

Get 1:1 Help Now