Subsonic, setting useSPs=“true” doesn't seem to work. SPs aren't being generated
-
16-09-2020 - |
Question
I am using subsonic, I'm reasonably new at it. Today is the first time I need to use stored procedures with it.
My provider line in the webconfig is as follows:
I am using two providers pointing at two different databases, where the other one isn't calling the SPs.
When I generate, I am getting all the tables and the class storedprocedures's but it is empty! So when I do SPs. ... in code there are no classes to display.
Does anyone know what's happening here?
UPDATE:
If I set UseSps="True" on my other provider.. it does work?
The databases are on completely different servers..
Bex
Solution 2
Right- for anyone who's got this problem.. I know what's causing it (in my case anyway).. will need a core code rewrite to fix..
If you go here it shows the source for generating the Sps. Go to line 1745
If I run this procedure in SQL Server I get this error:
Cannot sort a row of size 8098, which is greater than the allowable maximum of 8094.
Its because the stored procedures in the DB I am using are absolutely massive, so they are too long for the row when it orders by. Removing the order by in the core code will fix that error, but I don't know if it's needed??
I am going to submit it as an issue.
OTHER TIPS
I'm assuming you're using version 2.X of subsonic, not 3 ?
If so, you need to tell your config to generate stored procs, something like this:
<SubSonicService defaultProvider="blah">
<providers>
<clear />
<add
...
includeProcedureList="proc1,proc2"
If you're using version 3 you just need to run the T4 template for stored procs.