Hello I planned to genralize a stored procedure where i can pass the table name field names as parameter to the storedprocedure along with the values and then use those information to add or update the table which is passed as parameter. My stored procedure look like this CREATE PROCEDURE Add_Edit_GSupportTables(@AddMode bit,@GenCode int,@GenName varchar(100),@GenTable varchar(50),@GenCodeField varchar(50),@GenNameField varchar(50)) as declare @AutoCode numeric; if @AddMode = 1 begin select @AutoCode = max(@GenCodeField) from @GenTable set @AutoCode = isnull(@AutoCode ,0) set @AutoCode = @AutoCode +1 Insert Into @GenTable values(@AutoCode,@GenName) end else begin update @GenTable set @GenNameField =@GenName where @GenCodeField = @GenCode end GO but it gives incorrect syntax near @GenTable How to do so that this stored procedure can be used as functoin to add / edit with regards vimal Help in need is the help indeed