SQL STATEMENTS WITH TABLENAME AS ARGUMENT

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Gina L. Hernandez (pdwhitt_at_nospam.wdsinc.com)
Date: 05/05/04


Date: Wed, 5 May 2004 17:39:07 -0400

Hello:

In a stored procedure in SQL, I want to create a parameterized SELECT query
where the table name for
the query can be supplied as a parameter

SELECT * FROM "tablename"
where "tablename" is supplied as an argument just before the query runs.

Can someone help me with this syntax or tell me if this is possible or not?

Thanks



Relevant Pages

  • Re: Stored Procedures v Views
    ... Build a stored procedure, ... The goal here will be to not use any dynamic sql like you used in Access. ... If the query is very complex, but frankly, if you have to do this, you are ... > they make are then used to create the SQL statement which is then used to ...
    (microsoft.public.sqlserver.programming)
  • RE: Class Module Choices
    ... SQL Server has Stored Procedures. ... Perhaps you meant Stored Query with is different. ... When I said stored procedure, ... I don't know how to assign a value to Param1 within the execute command. ...
    (microsoft.public.access.formscoding)
  • Re: Stored Procedure
    ... We cannot delare variables within the SQL statements we build in Access. ... If I want 14284 I should do a seperate query whereas in a stored procedure I ... This is preferable to having the client submitting all those queries ...
    (microsoft.public.access.modulesdaovba)
  • RE: How to simple retrieve autonumber valuees or identity from data so
    ... you can write the equivalent of a stored procedure in Access. ... Simply write your SQL in a query and save it. ... > I use the access database in my simple application. ...
    (microsoft.public.dotnet.framework.adonet)
  • Help Please interfacing to SQL
    ... I'm still a novice when it comes to getting MS Access talking to SQL ... I have a pass through query in my access front end called ... Below is the stored procedure in the SQL database that it talks to(written ... NULL, @QueueItemDesc) ...
    (microsoft.public.access.queries)