Please start any new threads on our new site at http://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Calling a stored procedure in MS SQL externally?
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

SergioM
Posting Yak Master

170 Posts

Posted - 06/19/2013 :  18:17:53  Show Profile  Reply with Quote
I've created a stored procedure that updates my database. The thing is that it doesn't need to run at a regular interval. It should only run when it's called specifically.

It's easy enough to fire up SQL Server Management studio & type up EXEC ...., but I want to give someone the ability to do it without giving them access Management Studio. Is there an out of the box solution or am I stuck paying someone to make a custom script that connects to my DB & calls the command?

-Sergio
I use Microsoft SQL 2008

James K
Flowing Fount of Yak Knowledge

3873 Posts

Posted - 06/19/2013 :  20:29:52  Show Profile  Reply with Quote
You can use SQLCMD. Documentation and examples here:
http://msdn.microsoft.com/en-us/library/ms170207(v=sql.105).aspx
http://msdn.microsoft.com/en-us/library/ms162773.aspx
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52326 Posts

Posted - 06/20/2013 :  00:55:06  Show Profile  Reply with Quote
another option is powershell

http://www.dbascript.com/execute-sql-stored-procedure-from-powershell-with-parameters

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

SergioM
Posting Yak Master

170 Posts

Posted - 06/20/2013 :  09:22:03  Show Profile  Reply with Quote
Thanks guys. I forgot all about powershell! By the looks of the basic tutorial, that's exactly what I need.

-Sergio
I use Microsoft SQL 2008
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52326 Posts

Posted - 06/21/2013 :  02:11:57  Show Profile  Reply with Quote
welcome

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000