Page 1 of 1

SQL Server Stored Proc Execution

Posted: Thu Jun 05, 2014 6:55 pm
by simonpascoe
Is it possible to execute SQL Server stored procedures? If so, how? Thanks.

Re: SQL Server Stored Proc Execution

Posted: Thu Jun 05, 2014 7:07 pm
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>

Re: SQL Server Stored Proc Execution

Posted: Fri Jun 06, 2014 12:32 am
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.

Re: SQL Server Stored Proc Execution

Posted: Mon Nov 17, 2014 4:49 pm
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!

Re: SQL Server Stored Proc Execution

Posted: Mon Nov 24, 2014 1:25 pm
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