i'm in ubuntu 9.04 and using sql squirrel as my sql client. i connect to a remote SQL Server. There are some stored procedures in the db. I don't know how to execute them. No explicit gui. Earlier i was in windows and i could use management studio. I can right click on stored procedures and give Execute. You guys have any idea? Let me know. It will be helpful for me. :)
Asked
Active
Viewed 1.7k times
4
-
Can I suggest an edit to the Question title to replace "SQL Server" with "MSSQL Server" or "Microsoft SQL Server" to reduce confusion and make it clear which server this is for? – KC Baltz Apr 09 '14 at 20:39
3 Answers
7
Typically, if you want to execute a SQL Server stored procedure, you'd write:
EXEC Your-stored-proc-name-here @param1 = value1, @param2 = value2
and then execute that command. Typically, you should also use the dbo.StoredProcName
notation to avoid any confusion / problems.

marc_s
- 732,580
- 175
- 1,330
- 1,459
-
I had problems using the parenthesis. But managed to execute with exec **procname**, the rest is the same – Jose Muanis Aug 24 '11 at 21:29
-
additionaly, if you have output parameters, you need to declare them. tried to use examples but SO don't accept '@' – Jose Muanis Mar 22 '12 at 22:14
3
EXEC <STOREDPROCNAME> <PARAMLIST>
EXEC dbo.GetCandy 'Red',62
Then hit execute or the equivalent in your editor.

Kuberchaun
- 29,160
- 7
- 51
- 59
1
I had to tweak it slightly for a Microsoft SQL Server database (jsqlconnect driver). This worked for me:
execute <sproc_name> <args>

lance-java
- 25,497
- 4
- 59
- 101