SQL syntax

Results 1 to 2 of 2

Thread: SQL syntax

  1. #1
    Kelsi Guest

    Default SQL syntax

    What is the syntax for an sql select statement that uses a table that has been passed in by the ASP function? Ex. aspfunction (tablename)<BR>Select * from tablename<BR><BR>What is the syntax to let the select statement know that tablename is a variable?

  2. #2
    Jairo Guest

    Default RE: SQL syntax

    Kelsi,<BR>For an SQL Server stored procedure, you&#039ll want to have something like this:<BR><BR>CREATE PROCEDURE xSELECT<BR>( @tablename varchar(255) )<BR>AS<BR> exec ("select * from " + @tablename)<BR>GO<BR><BR>HTH,<BR>Jairo<BR>http://www.citywebarchitects.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts