I work in SQL Server 2000 and VB 6
I use sp to find a max value of specific column "ID"
in one specific table "Street"
CREATE PROCEDURE MaxID
@ParmID integer output
select @ParmID = max(ID) from Street
Because I have a lot of table with a same column and I want to look for
max value of "ID" column in those tables I want to use dynamic sql as
select @ParmId = max(ID) from @TableName
where @TableName is input parm for sp MaxID
Question is: HOW?