techzone12
Technical User
I have an ASP page with this code:
strTable = "table1"
oRsSubs.Open "Execute sp_Proc " & strTable, conn
The stored procedure in SQL looks like this:
CREATE PROCEDURE sp_Proc ( @strTable varchar(50) )
AS
EXEC('SELECT * FROM ' + @strTable)
This work fine. I am trying however to add some functionality to the code. Basically I want be able to pass some datetime values, besides the table name. Can you show me the ASP code and also the SQL code for the stored procedure.
I want to be able to execute a query like this:
execute('SELECT * FORM + '@strTable + 'where TimeStamp >' + @someDate')
Thanks
strTable = "table1"
oRsSubs.Open "Execute sp_Proc " & strTable, conn
The stored procedure in SQL looks like this:
CREATE PROCEDURE sp_Proc ( @strTable varchar(50) )
AS
EXEC('SELECT * FROM ' + @strTable)
This work fine. I am trying however to add some functionality to the code. Basically I want be able to pass some datetime values, besides the table name. Can you show me the ASP code and also the SQL code for the stored procedure.
I want to be able to execute a query like this:
execute('SELECT * FORM + '@strTable + 'where TimeStamp >' + @someDate')
Thanks