techzone12
Technical User
I have some ASP code that looks like this:
objRs.Open "Execute Proc1 " & strTableName & ", " & strColumn , objConn
The Stored procedure "Proc1" looks like this:
CREATE PROCEDURE [Proc1]
@strTable varchar(50),
@strColumn varchar(50)
AS
Exec('SELECT ' + @strColumn + ' FROM ' + @strtable + ' order by [timeStamp]')
I need to modify the above Stored Procedure to do something like this:
Exec('SELECT ' + @strColumn + ' FROM ' + @strtable + ' WHERE TimeStamp > ' + @DateVariable)
What's the syntax in the ASP when passing DateTime Variables to a Stored procedure? Can you give an example?
Also how should the Stored Procedure SQL code look like?
Thanks
objRs.Open "Execute Proc1 " & strTableName & ", " & strColumn , objConn
The Stored procedure "Proc1" looks like this:
CREATE PROCEDURE [Proc1]
@strTable varchar(50),
@strColumn varchar(50)
AS
Exec('SELECT ' + @strColumn + ' FROM ' + @strtable + ' order by [timeStamp]')
I need to modify the above Stored Procedure to do something like this:
Exec('SELECT ' + @strColumn + ' FROM ' + @strtable + ' WHERE TimeStamp > ' + @DateVariable)
What's the syntax in the ASP when passing DateTime Variables to a Stored procedure? Can you give an example?
Also how should the Stored Procedure SQL code look like?
Thanks