Hi,

I have a named query which is supposed to execute a stored procedure :

 <sql-query name="ConvertSource">
    exec sp_GENERIC_ConvertPublication :@PublicationID, :@Type
  </sql-query>

Here is the stored procedure code :

DECLARE @OldType AS INT

        SELECT @OldType = BroadMediaTypeID FROM dbo.Publication WHERE
PublicationID = @PublicationID


        --nulls all the columns that are irrelevant to 'Print' type
        IF (@Type = 1)
        BEGIN
                UPDATE dbo.Publication SET URL = NULL,
                                                                        
GoogleRank = NULL,
                                                                        
CGMMetric= NULL,
                                                                        
BroadMediaTypeID = @Type
                                                                    WHERE 
PublicationID =...@publicationid
        END

And I call the named query like this :

 SessionManager.GetCurrentSession()
        .GetNamedQuery("ConvertSource")
        .SetParameter("@PublicationID", pId)
        .SetParameter("@Type", pType).ExecuteUpdate();

But I get the following exception :

could not execute native bulk manipulation query:exec
sp_GENERIC_ConvertPublication :@PublicationID, :@Type[SQL: SQL not
available]

I'm not sure what this means but I have a feeling I shouldn't use
ExecuteUpdate().. . Is there any whay I can simply execute the stored
procedure ?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to