Page 1 of 1

[Parameter 'xxxxxx' not found] with TUniStoredProc

Posted: Wed 05 May 2010 13:25
by ephillipe
Hi, I am migrating my database of SQL2005 for SQL2008. When I try execute the same SP in 2008 database I get this error: [Parameter 'xxxxxx' not found].


My code:

Code: Select all

LStoredProc := TUniStoredProc.Create(Self);
LStoredProc.Connection := RetonarConexaoPadrao();
LStoredProc.StoredProcName := '[dbo].[sp_retornarOperadorPorLogin]';
LStoredProc.LockMode := lmNone;
LStoredProc.ParamCheck := True;
LStoredProc.Prepare;
LStoredProc.ParamByName('Login').AsString := Login;
LStoredProc.ExecProc;
My SP:

Code: Select all

ALTER PROCEDURE [dbo].[sp_retornarOperadorPorLogin] 
	-- Add the parameters for the stored procedure here
	@Login varchar(100)
AS

Posted: Wed 05 May 2010 13:32
by ephillipe
Additional Info:
SQL Server 2008 R2
SQL Server version: 10.50.1600

Same database restored in new server.

Posted: Wed 05 May 2010 13:51
by ephillipe
I found the problem. :roll:

The problem is USER permission. But, I found this only when I change the component of execution.

I change TUniStoredProc for TUniQuery. When I execute with query component, the error is more clear. If I execute a SP component, the error is masked.

Sds.