Page 1 of 1

Calling a Stored Procedure

PostPosted: Mon Mar 31, 2014 8:26 am
by ian
In the attached example a SQL Server Read Object can be used to run a Stored Procedure. The example runs against the Chinook sample database developed by Luis Rocha.

Three attachments are provided:
  • SQL scripts to create the Chinook database. These are provided with a small command file. The database is provided in two formats, one with auto incrementing primary keys and one without.
  • A script to add a Stored Procedure.
  • A sample DataSlave Map that calls the above Stored Procedure.
First create the Chinook database using the command file, then add the Stored Procedure using the provided script, then run the DataSlave Map.

The Map assumes Windows integrated security to a local SQLEXPRESS database. This can be adjusted if necessary. The Map illustrates how to call the Stored Procedure with a hard coded search parameter and also using Map and Transform .NET Scripts to pass a parameter.

Thanks to Luis for the Chinook database.

ChinookDatabase1.4_SqlServer.zip
(375.08 KiB) Downloaded 838 times

Chinook_FindArtists_SP.zip
(418 Bytes) Downloaded 696 times

CallStoredProcedure.zip
(4.26 KiB) Downloaded 706 times