-
July 18th, 2008, 05:33 AM
#1
[RESOLVED] SQL 2005 - Stored procedure parameter problem
Hi all!, I've a SQL Express 2005 database that have many tables with AFTER INSERT/UPDATE triggers that does the same on all the tables.
Then, i've created an StoredProcedure to be called within these triggers.. so less repeteable code and an advantage on future changes..
The stored proc:
Code:
CREATE PROCEDURE [dbo].[sp_ControlarModificacion]
-- Add the parameters for the stored procedure here
@Tabla table,
@Clave int
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
update @Tabla set FechaModificacion = GETDATE(), UsuarioModificacion = USER where clave = @clave
END
And the call from the trigger will be some like..
Code:
exec dbo.sp_ControlarModificacion inserted, @Clave
But i've a problem, SQL Server throw me the error "Incorrect syntax near the keyword 'table "when i try to save the stored procedure.
Some ideas? Thanks!
Last edited by satanorz; July 18th, 2008 at 06:22 AM.
Reason: Solved ;)
-
July 18th, 2008, 05:55 AM
#2
Re: SQL 2005 - Stored procedure parameter problem
I do not think you can parse a table as input to a SPROC in SQL Server 2005 (or earlier).
You'll have to parse the specific parameters in, instead of the table.
-
July 18th, 2008, 06:09 AM
#3
Re: SQL 2005 - Stored procedure parameter problem
The problem is that i need the parameter to be a table, because i need to make an update on it :S
-
July 18th, 2008, 06:21 AM
#4
Re: SQL 2005 - Stored procedure parameter problem
-
July 19th, 2008, 07:49 AM
#5
Re: SQL 2005 - Stored procedure parameter problem
i would never do this.. the performance implications are horrendous
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|