subsonic / SubSonic-3.0-Templates

T4 Template Project for the peeps
http://subsonic.github.io/
105 stars 46 forks source link

Subsonic 3.0.0.3 not generating parameters for stored procedures #28

Closed michaelstonis closed 6 months ago

michaelstonis commented 15 years ago

I have a SQL Server 2008 database with a bunch of stored procedures. When I use the ActiveRecord Template provided with Subsonic 3.0.0.3, it generates methods for all of my stored procedures, but they do not have any parameters. I am dbo on the server and can execute the stored procedures with no issue from Management studio.

Example Stored Procedure

CREATE PROCEDURE [dbo].[prc_Sample] @FileName VARCHAR(50) AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON;

IF EXISTS ( SELECT * FROM Sample WHERE FileName = @FileName )
BEGIN
    RETURN -1
END

RETURN 0

END

Sample Generated Method

public StoredProcedure prc_Sample(){ StoredProcedure sp=new StoredProcedure("prc_Sample",this.Provider); return sp; }

If I check SQLServer.ttinclude, I can see that all of methods for getting stored procedures are there, but for some reason they are not generating.

Any ideas or anyone know how to debug a template file?

jamesewelch commented 15 years ago

possible answer at SO?

http://stackoverflow.com/questions/1349201/subsonic-3-0-0-3-not-generating-parameters-for-stored-procedures

michaelstonis commented 15 years ago

This fix worked for me: http://stackoverflow.com/questions/1349201/subsonic-3-0-0-3-not-generating-parameters-for-stored-procedures/1363939#1363939