Skip to content

SQL Server Stored Proc Execution

Post any question you may have in regards to GoAnywhere Director and let our talented support staff and other users assist you.
  • simonpascoe Offline
  • Posts: 2
  • Joined: Thu Jun 05, 2014 6:51 pm

SQL Server Stored Proc Execution

Post by simonpascoe »

Is it possible to execute SQL Server stored procedures? If so, how? Thanks.
  • Support_Rick Offline
  • Support Specialist
  • Posts: 590
  • Joined: Tue Jul 17, 2012 2:12 pm
  • Location: Phoenix, AZ
  • Contact:

Re: SQL Server Stored Proc Execution

Post by Support_Rick »

Just run a normal SQL Query ... like this:

Code: Select all

		<sql label="Call MSSQL Stored Proc" resourceId="MSSQL Rick&apos;s Laptop" version="1.0">
			<query label="Execute Stored Proc">
				<statement>EXEC proc_name</statement>
			</query>
		</sql>
Rick Elliott
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
  • simonpascoe Offline
  • Posts: 2
  • Joined: Thu Jun 05, 2014 6:51 pm

Re: SQL Server Stored Proc Execution

Post by simonpascoe »

Thanks. My issue was that I was using a fully qualified name for the stored procedure instead of just the stored procedure name.
  • WallyD444 Offline
  • Posts: 10
  • Joined: Wed Sep 17, 2014 8:38 am

Re: SQL Server Stored Proc Execution

Post by WallyD444 »

Hi, I have GA Director 4.1.1, and it's giving an "Invalid SQL statement" error trying to execute a stored procedure:

Code: Select all

<project name="Database Exec Test1" mainModule="Main" version="2.0" logLevel="normal" threadSafe="true">

	<module name="Main">

		<sql label="DBConnection" resourceId="WORK" autoCommit="true" version="1.0">
			<query label="query1">
				<statement>EXEC EXTRACT_DATA</statement>
			</query>
		</sql>

	</module>

	<description>WORKBENCH</description>
</project>
Any ideas?

thanks!
  • Support_Rick Offline
  • Support Specialist
  • Posts: 590
  • Joined: Tue Jul 17, 2012 2:12 pm
  • Location: Phoenix, AZ
  • Contact:

Re: SQL Server Stored Proc Execution

Post by Support_Rick »

Wally,

If you're not pointing to the current Database that has the Stored Procedure, you'll need to do that as well. Something like:

<statement>
Use MyDB;
Exec MyStoredProc;
</statement
Rick Elliott
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
Post Reply