Results 1 to 4 of 4

Thread: SELECT FROM parameter as viewName?

Threaded View

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    SELECT FROM parameter as viewName?

    in SQL when using say a SPROC (Stored Procedure), is there a way to use a parameter for the "FROM" part of the statement?

    for example:


    SELECT @fieldName FROM @viewOrTableName


    ?

    if so how? as currently the syntax error is that @viewOrTableName must be declared, but they are as parameters....in addition what about the fieldname parameter?
    Last edited by Techno; May 29th, 2007 at 09:15 AM.

    MVP 2007-2010 any chance of a regain?
    Professional Software Developer and Infrastructure Engineer.

Posting Permissions

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



Click Here to Expand Forum to Full Width