Calling a Stored Procedure

Some tips for the use of DataSlave

Moderators: Tom, ian

Calling a Stored Procedure

Postby ian » Mon Mar 31, 2014 8:26 am

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 489 times

Chinook_FindArtists_SP.zip
(418 Bytes) Downloaded 496 times

CallStoredProcedure.zip
(4.26 KiB) Downloaded 494 times
ian
 
Posts: 364
Joined: Sat Dec 18, 2004 8:13 am
Location: UK

Return to Tips

Who is online

Users browsing this forum: No registered users and 1 guest

cron