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

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Calling a stored procedure in MS SQL externally?

Author  Topic 

SergioM
Posting Yak Master

170 Posts

Posted - 2013-06-19 : 18:17:53
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
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2013-06-19 : 20:29:52
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

52326 Posts

Posted - 2013-06-20 : 00:55:06
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 - 2013-06-20 : 09:22:03
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

52326 Posts

Posted - 2013-06-21 : 02:11:57
welcome

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

- Advertisement -