I have a stored procedure defined with a single parameter whose type is a user-defined data type. On occasion when a call to this stored procedure is made I get an error "Invalid object name @ids". On a particular day I will this error only for a single stored procedure. We don't make any changes to the stored proc, or the C# code, but the next day everything works fine. I have attempted to pass different types of invalid data to the SP, like passing a null, or a table with the wrong data type for the columns, no data, etc. Using SSMS I have attempted to call this SP with different types of data for the parameters but nothing have done seems to generate this error.
My network people assur me that nothing with user permissions is being modified overnight. The SQL admins have checked the sql and system logs and there are no other errors being thrown.
In the SQL Profiler, I see 3 events, RPC:Starting, then SP:Starting, the RPC:Completed with a 1-Error in the error column.
I am tracing sp, rpc and sql statements.
The call to the stored proc is made by calling sp_procedure_params_rowset to get a list of parameters then building the stored procedure call. This is well tested code and always works as expected so I don't think how the stored proc call is built is what is causing this issue.
Any idea what could cause this?
SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE PROCEDURE [dbo].[pc_ccs_check_ids] @ids as dbo.single_id_clustered readonly AS BEGIN SET NOCOUNT ON SELECT det.id, ch.[level] FROM @ids det INNER JOIN change ch on det.id = ch.id END GO
Thank you for any help you can provide.