Results 1 to 2 of 2

Thread: Using sp_ExecuteSQL and passing Table Name

  1. #1
    Pargat Guest

    Using sp_ExecuteSQL and passing Table Name

    I am creating a dynamic sql statement in a stored procedure.
    The stored procedure has table name passed in.
    I cannot pass in the table name as a parameter.

    How do I pass the table name as a paramter is a dynamic sql statement


  2. #2
    Jim W Guest

    Using sp_ExecuteSQL and passing Table Name (reply)

    The only way to specify a table name is by building a query string and running exec, as in exec("select * from " + @mytable)


    ------------
    Pargat at 1/11/01 10:50:18 AM

    I am creating a dynamic sql statement in a stored procedure.
    The stored procedure has table name passed in.
    I cannot pass in the table name as a parameter.

    How do I pass the table name as a paramter is a dynamic sql statement


Posting Permissions

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